전체 글
-
OOD(객체지향 개발)의 원칙Programming/Technical 2011. 9. 21. 19:37
1. SRP - 어떤 클래스를 변경해야 할 이유는 오직 하나뿐이어야 한다. 2. OCP - 클래스를 변경하시 않고도 어떤 클래스의 환경을 변경할 수 있어야 한다. 3. LCP - 유도된 클래스의 메소드를 퇴화시키거나 불법으로 만드는 일을 피하라 기반 클래스의 사용자는 그 기반 클래스에서 유도된 클래스에 대해 아무것도 알 필요가 없어야 한다. 4. DIP - 자주 변경하는 컨크리트 클래스 대신 인터페이스나 추상 클래스에 의존하라. 5. ISP - 어떤 객체의 사용자에게 그 사용자한테 필요한 메소드만 있는 인터페이스를 제공하라
-
-
설계의 품질Programming/Technical 2011. 9. 7. 21:07
-나쁜 설계의 냄새- 1. 경직성 : 무엇이든 하나를 바꿀 때마다 반드시 다른 것도 바꿔야 하며, 그러고 나면 또 다른 것도 바꿔야 하는 변화의 사슬이 끊이지 않기 때문에 시스템을 변경하기 힘들다. 2. 부서지기 쉬움 : 시스템에서 한 부분을 변경하면 그것과 전혀 상관없는 다른 부분이 작동을 멈춘다. 3. 부동성 : 시스템을 여러 컴포넌트로 분해해서 다른 시스템에 재사용하기 힘들다. 4. 끈끈함 : 개발 환경이 배관용 테이프나 풀로 붙인 것처럼 꽉 달라붙는 상태다. 편집 - 컴파일 - 테스트 순환을 한 번 도는 시간이 엄청나게 길다. 5. 쓸데없이 복잡함 : 괜히 머리를 굴려서 짠 코드 구조가 굉장히 많다. 이것들은 대개 지금 당장 하나도 필요 없지만 언젠가는 굉장히 유용할지도 모른다고 기대하며 만들었다..