Many of these smells are a result of mismanaged dependencies. Mismanaged dependencies
conjure the view of code that is a tangled mass of couplings. Indeed, it is this view of
entanglement that was the origin of the term “spaghetti code”.

Object oriented languages provide tools that aid in managing dependencies. Interfaces
can be created that break or invert the direction of certain dependencies. Polymorphism
allows modules to invoke functions without depending upon the modules that contain
them. Indeed, an OOPL gives us lots of power to shape the dependencies the way we
want.


잘못된 코드는 객체의 의존관계 관리를 잘못한 결과물이라 할 수 있다. 
잘못된 의존관계는 복잡하게 꼬여서 coupling을 가지는 코드의 관점을 만들어 내고,
실제로 이것은 '스파게티 코드'라는 말의 어원이 되었다.

객체지향언어는 관계 관리에 도움을 주는 툴을 제공해준다.
인터페이스는 어떤 직접적인 관계를 방지해주도록 사용될 수 있다.
다형성(Polymorphism)은 모듈이 어떤 모듈에 대해 의존성 없이 기능을 사용할 수 있게 해준다
객체지향 어언는 우리가 원하는 형태의 의존 구조를 만드는데 도움을 준다.


+ Recent posts