61条面向对象设计的经验原则(61 empirical principles of object oriented design).docVIP

  • 0
  • 0
  • 约1.01万字
  • 约 10页
  • 2017-10-05 发布于河南
  • 举报

61条面向对象设计的经验原则(61 empirical principles of object oriented design).doc

61条面向对象设计的经验原则(61 empirical principles of object oriented design)

61条面向对象设计的经验原则(61 empirical principles of object oriented design) 61 empirical principles of object oriented design You do not have to abide by these principles, and they will not be punished by religion. But you should think of these principles as alarm bells, and if one of them breaks, the alarm rings. -----Arthur J.Riel (1) all data should be hidden within the class in which it is located. P13 (2) users of a class must rely on the shared interface of the class, but the class cannot rely on its users. P15 (3) minimize the message in the class agreement. P16 (4) implement the most basic public interfaces that all classes understand (e.g., copy operations (deep copy and shallow copy), equality judgment, correct output, description from ASCII, resolution, and so on.]. P16 (5) do not put the implementation details (such as the private function of placing common code) into the public interface of the class. P17 If the two methods of the class have a section of public code, you can create a private function that prevents these public code. (6) do not disturb the public interface of a class with something that the user cannot use or is not interested in. P17 (7) there should be zero coupling between classes, or only the coupling relationship can be derived. That is, a class has nothing to do with the other class, or uses only the operations in the public interface of another class. P18 (8) a class should represent only one critical abstraction. P19 All classes in the package should be closed for changes in the same class of properties. If a change affects a package, it affects all classes in the package, without any impact on other packages (9) place the relevant data and behavior centrally. P19 Designers should be aware of objects that get data from other objects through operations such as get. This type of behavior implies that this empirical principle is violated. (10) putting irrelevant information in another class (i.e., behavior that does not communicate with each

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档