Class Diagram A Class defines the attributes and the methods of a set of objects. All objects of this class (instances of this class) share the same behaviour, and have the same set of attributes (each object has its own set). Stereotype for Attributes & Operations private - public + protected # Class Dependency Dependency is a form of association that specifies a dependency relationship between two classes. An arrowhead can be used to indicate an asymmetric dependency. Symmetric dependency doesn’t have arrowhead
Generalization- Inheritance a Generalisation association between two classes puts them in a hierarchy representing the concept of inheritance of a derived class from a base class
Association Associations can have a role that specifies the purpose of the association and can be uni- or bidirectional (indicates if the two objects participating in the relationship can send messages to the other) An association usually means that you have a sentence that describes a relation between two (or more) classes. Examples of associations: Node class contains Attribute classes. Driver class drives Car class. Transaction class modifies Table classes. Manager class starts Machine class. Page class contains Widget classes.
Composite Aggregation Composition is a form of symmetric association that specifies a whole-part relationship between the composition (whole) class and a subordinate (part) class in which removing the whole also removes the parts. For example: In relational databases, a cascading delete is a good example of a composition relationship. Window contains title, Table row and columns A whole-part relationship between the Person (whole) class and the Head (part) class. In this example, removing the person also removes the head and removing the head effectively destroys the person - the person and head must exist together in the context of a living person
(Shared)Aggregation <ul><li>Aggregation is a form of asymmetric association that specifies a whole-part relationship between the aggregate (whole) class and a subordinate (part) class. </li></ul><ul><li>The shared aggregation indicates that some classifier (process or class) cannot be performed/completed without another classifier. </li></ul><ul><li>In the example illustration below, there is a whole-part relationship between the Car (whole) class and the Engine (part) class. In English, this would be stated as Engine is a part of Car </li></ul><ul><li>Book reading is not possible without a book but the book can be used in two different reading processes. Another example: database driven web form consists of fields, actions and pooled data connection and the connection can be used by another form/control </li></ul>