# Global data > 코드 악취 중 하나. [코드 악취](https://wiki.g15e.com/pages/Code%20smell.txt) 중 하나. ## 전역 데이터의 여러 형태 > The most obvious form of global data is global variables, but we also see this problem with class variables and . --Chapter 3, [Refactoring: Improving the design of existing code](https://wiki.g15e.com/pages/Refactoring%20-%20Improving%20the%20design%20of%20existing%20code.txt) 어디에서나 직접 접근할 수 있다는 게 문제. [데이터베이스](https://wiki.g15e.com/pages/Database.txt)는 그 자체로 문제가 아니지만 코드 어디에서나 데이터베이스에 접근한다면 문제가 된다. 파일 시스템도 마찬가지. ## 변경가능성 > Global data is especially nasty when it’s mutable. Global data that you can guarantee never changes after the program starts is relatively safe—if you have a language that can enforce that guarantee. --Chapter 3, [Refactoring: Improving the design of existing code](https://wiki.g15e.com/pages/Refactoring%20-%20Improving%20the%20design%20of%20existing%20code.txt) ## 관련 리팩토링 - ## 인터페이스 [모드](https://wiki.g15e.com/pages/Mode%20(interface.txt))와의 관련성 전역 데이터는 인터페이스 디자인에서의 [모드](https://wiki.g15e.com/pages/Mode%20(interface.txt))와 관련이 있다. <제프 래스킨>은 모드를 이렇게 정의한다: > A is modal with respect to a given gesture when (1) the current state of the interface is not the user's [locus of attention](https://wiki.g15e.com/pages/Locus%20of%20attention.txt) and (2) the interface will execute one among several different possible responses to the gesture, depending on the system's current state…. --Chapter 3, [The humane interface](https://wiki.g15e.com/pages/The%20humane%20interface.txt) 전역 데이터도 인터페이스의 모드와 마찬가지로 프로그래머의 [주의소재](https://wiki.g15e.com/pages/Locus%20of%20attention.txt)에 있지 않으면서 코드의 동작에 영향을 준다는 점에서 실수를 유발하기 쉽다.