4.1 面向对象分析(二) 标识概念类和对象

标识概念类和对象

   原则

     类,表示一组具有相同行为、属性的对象

      Remember that a class represents a group (classification) of objects with the same behaviors

     类,在表示对象群体的时候,一般用单数

      Generally, classes that represent objects should be given names that are singular nouns

         如 Coin, Student, Message

     根据类,可以创建所需要数量的对象个体

      We are free to instantiate as many of each object as needed

     类名的选择,很重要!要能够帮助大家理解

       如 Customer? Or User: 哪个更好,视情况而定

原文地址:https://www.cnblogs.com/mayZhou/p/10548110.html