데메테르의원칙
-
[OOP] Law of Demeter: 최소 지식 원칙프로그래밍 2024. 7. 11. 19:04
최소 지식 원칙, 소프트웨어 개발을 위한 가이드라인 중 하나이며, 특히 느슨한 결함(loose coupling)을 위한 방법 중 하나이다. ## 1987년, Ian Holland에 의해 제안되었다.요약해보면,Each unit should have only limited knowledge about other units: only units "closely" related to the current unit.(각 객체는 "밀접하게" 관계된 다른 객체들에 대해서 제한된 지식만 가져야 한다.)Each unit should only talk to its friends; don't talk to strangers.(각 객체는 그 친구와만 대화해야한다; 낯선이와 이야기하지 말아라.)Only talk to your..