8
1 Relations between Relations between Class Diagrams - UML Class Diagrams - UML Harish Alwala Harish Alwala

Relations Class Diagram

  • Upload
    halwal

  • View
    2.599

  • Download
    0

Embed Size (px)

DESCRIPTION

Describe various attributes that Serve the Relations between class diagrams in uml

Citation preview

Page 1: Relations Class Diagram

11

Relations between Class Relations between Class Diagrams - UMLDiagrams - UML

Harish AlwalaHarish Alwala

Page 2: Relations Class Diagram

22

TerminologyTerminology

• Class Diagram• Aggregation• Association• Generalization• Realization• Composition

Page 3: Relations Class Diagram

33

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 & Operationsprivate -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

Class DiagramClass Diagram

Page 4: Relations Class Diagram

44

Generalization- Generalization- InheritanceInheritance

a Generalisation association between two classes puts them in a hierarchy representing the concept of inheritance of a derived class from a base class

Page 5: Relations Class Diagram

55

AssociationAssociation

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.

Page 6: Relations Class Diagram

66

Composite AggregationComposite AggregationComposition 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 columnsA 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

Page 7: Relations Class Diagram

77

(Shared)Aggregation(Shared)AggregationAggregation is a form of asymmetric association that specifies a whole-part relationship between the aggregate (whole) class and a subordinate (part) class.The shared aggregation indicates that some classifier (process or class) cannot be performed/completed without another classifier.

•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

•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

Page 8: Relations Class Diagram

88

Thank YouThank You

Thank YouThank You