????1.1 ???????“????”???????Symptoms of Rotting Design??

????????????????????????????????????“????”?С?????????????????????????????????????????????????????????????????????????

????1. ??????Rigidity Rigidity ???????????????????????????????????????????????????????????????????????????????????????????????ɡ?

????2. ???????Fragility Fragility ??????????????????????????????????????????????????????????????????????С?????????????????????????????????????????????????????????

????3. ??????????immobility immobility ????????????????????????С????????????λ???е???????????????????????????????????????????????????????????????????????????????д?????????á?

????4. ????????viscosity viscosity???????????????viscosity???????viscosity.????????и??????????????????в???????????????????? ????Щ?????У??Щ??????е??????????????Щ????????????Щ????hacks???????????????????????????????????????????? viscosity ?????

??????????viscosity?????????????????????Ч?????

????2 ????????????????

????2.1 ?????????The Open Closed Principle ??OCP??

????A module should be open for extension but closed for modification.????????????????????????????????????????????????????????????????

?????????е???????????????У?????????????????????????????????????????????????????????????

????2.1.1 ?????????Dynamic Polymorphism??

????2.1.2 ?????????Static Polymorphism??

??????????????OCP???????????????????Listing 2-3.LogOn???????????????????????????????modem. 2.1.3 OCP??????????Architectural Goals of the OCP??

???????????OCP?????Щ????????????????????????????????????????顣?????????????????????????1?????????????μ?????????????? ?????? ?? 3 ????? 17 ????????????OCP?????????????????????????OCP????????????????????к?????????????ü??????仯??????????????????????? ???????

????2.2 Liskov ?滻???The Liskov Substitution Principle??LSP??

????Subclasses should be substitutable for their base classes.???????????滻?????

????Derived????????滻??Base????????Base???????????User?????????????Devrived???????Base?????????????????????????

????2.3 ????????????The Dependency Inversion Principle ??DIP??1

????Depend upon Abstractions. Do not depend upon concretions.??????????????????塣

????????OCP??????OO???????????DIP???????????????????????????????????????????????????????????????????????????????????????????????????COM??CORBA??EJB?????????????

????2.3.1 ????????Depending upon Abstractions.

?????????????????????е?????????????????????????????????κ??????????

??????????????????????????????????t????????????????????????????????仯??????????仯???????????????“????”??????Щλ???????????????????????????y??и????OCP????

????2.4 ?????????The Interface Segregation Principle ??ISP??

????Many client specific interfaces are better than one general purpose interface???????????????????????y???

????ISP???????????????????COM????????????????????????????????????????????????????????????????????м??????????????? ????????????????????????????з?????????????????????????????????????????????????Щ????