명시적인 의존성
-
오브젝트 4 - 메세지, 인터페이스, 의존성책책책 책을 읽읍시다/프로그래밍 2023. 2. 13. 23:21
퍼블릭 인터페이스와 오퍼레이션 객체가 의사소통을 위해 외부에 공개하는 메세지의 집합을 퍼블릭 인터페이스라고 부른다. 프록래밍 언어의 관점에서 퍼블릭 인터페이스에 포함된 메세지를 오퍼레이션(operation)이라고 부른다. 오퍼레이션은 수행 가능한 어떤 행동에 대한 추상화다. 흔히 오퍼레이션이라고 부를 때는 내부의 구현 코드는 제외하고 단순히 메세지와 관련된 시그니처를 가리키는 경우가 대부분이다. 영화 예매 시스템의 예로 DiscountCondition 인터페이스에 정의된 isSatisfiedBy가 오퍼레이션에 해당한다. public interface DiscountCondition { boolean isSatisfiedBy(Screening screening); } 그에 비해 메세지를 수신했을 때 실제로..