0
4.0kviews
Explain : (i) Attributes (ii) Link attributes with reference to class and object.

Subject: Object Oriented Modeling and Design

Difficulty: Medium

Marks: 4 Marks

1 Answer
0
298views

(i) Attributes: - An attributes is a named property of a class that describes a value held by each object of the class. A class may have any number of attributes or no attributes at all. An attribute represents some property of the thing that is shared by all the objects of that class. Attributes are listed in the second part of Class Box. Each attribute name may be followed by optional details. Each attribute name is unique within a class.

For Example: Class Person has attributes Name, Birthdate and weight. Name is string, Birthdate is Date and Weight is integer.

enter image description here

(ii) Link attributes: - Link attribute specify properties of link/association between two classes/objects.

For example: In the below example company and person has a link/association between them which has link attributes as description, datehired and salary. These attributes are placed inside the association class job. Association class is linked to association line with dashed line.

enter image description here

Please log in to add an answer.