16
UML Diagrams Class Diagram

Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

Embed Size (px)

DESCRIPTION

1. Class 2. Attribute 3. Methods (Operations) 4. Generalization 5. Association 6. Multiplicity 7. Aggregation

Citation preview

Page 1: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

UML DiagramsClass Diagram

Page 2: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

Class diagrams Class diagrams show the classes of the

system, their interrelationships (including inheritance, aggregation, and association), and the operations and attributes of the classes.

Class diagrams are used for a wide variety of purposes, including both conceptual/domain modeling and detailed design modeling.

Page 3: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

Class diagrams elements

1. Class2. Attribute3. Methods (Operations)4. Generalization5. Association6. Multiplicity7. Aggregation

Page 4: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

1. Class An object is any person, place, thing,

concept, event, screen, or report applicable to your system.

A class is a representation of an object and, in many ways, it is simply a template from which objects are created.

Although thousands of students attend the university, you would only model one class, called Student, which would represent the entire collection of students.

Page 5: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

2. Attribute An attribute of a class represents a

characteristic of a class. Characteristics of interest of a

passenger, for example, are name and age.

Page 6: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

3. Methods (Operations) The operations describe how a class can

interact with data. All classes have different access levels

depending on the access modifier (visibility). Here are the following access levels with their

corresponding symbols: Public (+) Private (-) Protected (#) Static (underlined)

Page 7: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

4. Generalization Terms such as superclass, subclass, or

inheritance come to mind when thinking about the object-oriented approach.

Generalization is the process of extracting shared characteristics from two or more classes, and combining them into a generalized superclass. Shared characteristics can be attributes, associations, or methods.

Page 8: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

4. Generalization

Page 9: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

5. Association An association represents a

relationship between two classes. An association indicates that objects of

one class have a relationship with objects of another class, in which this connection has a specifically defined meaning.

Page 10: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

6. Multiplicity A multiplicity allows for statements

about the number of objects that are involved in an association.

Page 11: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

7. Aggregation An aggregation is a special case of an

association meaning "consists of“

Page 12: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and

Examples

Page 13: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and
Page 14: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and
Page 15: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and
Page 16: Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and