Presentation is loading. Please wait.

Presentation is loading. Please wait.

Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.

Similar presentations


Presentation on theme: "Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates."— Presentation transcript:

1 Class Diagrams Revisited

2 Parameterized Classes Parameterized Classes - are used to represent relationships between templates.

3 Abstract Classes Abstract Classes - are classes for which instances are not generated. These classes may have abstract methods. Examples: an abstract superclass account and subclass cheque, loan and savings; an abstract superclass customer and subclasses credit and cash customer.

4 Utility Classes Are collections of global variables and functions. Example:

5 Object Diagrams Are used to specify instances of a class with specific values for the data elements. Example:

6 Interface Classes Interface classes - represent interfaces. Example:

7 Conceptual vs. Implementation Class Diagrams Conceptual class diagrams are used to describe the objects and behaviours in the domain. Class diagrams can also be used for implementation purposes, i.e. to model classes to be implemented as a program.

8 Associations Aggregation is a type of association and composition is a type of aggregation. Aggregation is an association which links a part to an entirety. Composition - is an aggregation in which the “part” will not exist if the “entirety” did not exist.

9 Aggregation Syntax Example

10 Composition Example

11 Attributes Specify the type of the attribute Specify the accessibility of the attribute: + for public, # for protected and - for private Derived attributes - the value of the attribute is derived from other attributes, e.g. the age attribute will be derived from the current date subtract the birth date. This is denoted by /age=date-birthdate.

12 Methods Specify the return type if not void Specify the type of each parameter Specify the accessibility of the method: + for public, # for protected and - for private Some methods may be abstract. This must be indicated in brackets “{abstract}”


Download ppt "Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates."

Similar presentations


Ads by Google