
本文共 9412 字,大约阅读时间需要 31 分钟。
���������������������������������������������������������������������������C���������������������������
������������������������������������������,������������������������������������������������������������
���������/���������/������������/������������/������������/������������/������������/���������
���������������������������
������������(OPEN CLOSE PRINCIPLE)������������������������������������������������������������������������������������(Software entities should be open for extension���but closed for modification)���
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(���������������������������������������������������������������������������������������������)���
������������������(Single-Responsibilitiy Principle)������������������������������������������������������������There should never be more than one reason for a class to change���
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������
������������������(Liskov Substitution Principle)������������������������������������������������������������������������Inheritance should ensure that any property proved about supertype objects also holds for subtype objects���
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Java���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
LSP������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������-������������������������������������-���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������(Dependence Inversion Principle)���������������������������������������������������������������������������������������������������������������������������������������High level modules shouldnot depend upon low level modules.Both should depend upon abstractions.Abstractions should not depend upon details. Details should depend upon abstractions������
������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������
���������������������������������������������������������
������������������������������������������
������������������������������������������������
������������������(Interface Segregation Principle)��� ���������������������������������������������������������������������The dependency of one class to another one should depend on the smallest possible interface���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Clients should not be forced to depend on methods they do not use������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������
���������������||������������������(Low of Demeter Principle||Least Knowledge Principle)������������������������������������������������������������������Talk only to your immediate friends and not to strangers���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(���������������������)���
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������public������������������������������������������������������������������������������������������
���������������������������(���������������������������������������������������)������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������ 6 ������
������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������
������������������������������������������������������������������
���������������������������������������������������������������������������
������������������������������������������������������������������set ��� get ������������
������������������������Serializable���������
������||������||������������������(Composition/Aggregation Reuse Principle(CARP) )���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������
���������������
发表评论
最新留言
关于作者
