![]() ![]() In the third compartment, some entries have plus signs, whereasothers have minus signs. You'll notice that each entry in the second compartment has a minus signin front of it. If we can draw an English analogy, theproperties of an object are like the nouns of a sentence. Therefore, the state of the object is suchthat it is moving forward at 55 mph. ![]() For example, ifthe CurrentGear value is 4 and CurrentSpeed is 55, it seems reasonable to assume that the Vehicle object isgoing forward at 55 miles per hour. Collectively, the currentvalues of the properties describe the state of a class object. Each property can assume different values. NET tends to refer to these attributes as the properties of theclass. ![]() In amore complete example, there could be dozens of attributes for a class. In our example, compartment two has six Integer attributes. There are no spaces between the words in a class name.įigure 3.2 A sample UML class diagram for a class named Vehicle. For example, class names that follow this naming convention would include Vehicle, PassengerCar, and IncomeStatement. If the class name contains more than one word, each word in the class name is in uppercase. The standard naming convention for class names is to begin the class name with an uppercase letter. The methods of the class tell us whatthe class can do.įigure 3.2 shows a class diagram with the class name Vehicle in the first compartment. (You'll also hear the attributes of a classreferred to as the properties or variables of the class.) Thethird compartment contains class methods. The second compartment containsattributes of the class. Starting at the top of the class diagram, thefirst compartment contains name of the class. The standard UML diagram, or notation, for a class is a rectangle that'sdivided into three compartments. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |