????3 ????????????Principles of Package Architecture

??????????????????????????????????????????????????????????????????????????Э?????????????????????????????????????????????????????????

????3.1 ????????

????3.1.1 ?????????????The Release Reuse Equivalency Principle ??REP??1

?????????????????????????The granule of reuse is the granule of release.????????????????????????????????????????????????????Release???????????????????á??????????????Щ? ?θ???????????????????????????????????????????????????°汾??????????????????汾??????????????????????°汾??

???????????????????????е??ж????????????????????????????С????????????????????С?????????????y????????????????С?

????3.1.2 ?????????The Common Closure Principle ??CCP??2

???????仯??????????Classes that change together?? belong together.????????????????????????????????????????????????Щ????????????????????????????κ??????????汾?У??????? ??????????????????????????????????????t?????????????????????б????????????????????????????仯?????????????? ??????

????3.1.3 ??????????The Common Reuse Principle ??CRP??3

??????????????????÷??????Classes that aren‘t reused together should not be grouped together.????????????????????????ж????????????????????????????????????????????????????????????У???????????????????? ?θ??????С?

?????????????????????????????????????????????????°汾??????????????????????????????????????汾???????????°汾????κ???????????????????

??????????????????????????????????????????????????????????????????????????????°汾???????????????????????????????????????С?

????3.1.4 ????????????????Tension between the Package Cohesion Principles

??????????????????????????????????????????????????????????棬????????????к????REP??CRP????????????????к????CCP ?????????к????CCP??e??о???????????????????????е??????????????????????????????仯????CRP??????e???С??

????????????????????????????????????????????У?????????????????????????????????????????????????????????????????CCP??????? λ???????????????????????????????????????????????????????????????REP??CRP?????????????????????????

????3.2 ????????The Package Coupling Principles.

???????????????????????????????

????3.2.1 ????????·???The Acyclic Dependencies Principle ??ADP??1

??????????????????????γ??·??The dependencies between packages must not form cycles.??????????????????????????????????????????????????????д??????????????????????????????????????????????????? ???????????顣

???????????????????????????????????????????Щ?????????????????????????????????????????????????в???????????????????????????????????????????е????

????3.2.2 ??????????Stable Dependencies Principle??SDP??

??????????????????Depend in the direction of stability.???????????????????????????????滹???к??????????????????????????????????

????????????????????????????????????????????????????????????????????????λ?ú??????????б仯??????????????????????????? ??????????????????????????????????????????С???????????????????????????????????????

????????????????????????????????????????????????????С??????????????????Щ????????????????????????????к??????????????? ?????????????????????????????????????????????????????????e?????????????????????κ???????????????????????????????

????3.2.3 ?????????? Stable Abstractions Principle ??SAP??

?????????????????????Stable packages should be abstract packages.?????????????ó??????????????????????????????????в????????????????????????????е??????????????Щ????? ?????????????????????Щ???????????????????????????棺?????????????????????????

?????????????????????????????????????????????????????????????????????λ???????????????????????????????????????????OCP??????????????????????