You are on page 1of 37

Class Diagram

Class Diagram related topics: The material that will be discussed is mainly covered by Bahrami A., "Object Oriented System
Development", McGraw Hill, 2003. [Part 2, ch-5] & refer PPT and other (as per syllabus) reference books for rest of the covered
topics.

Packages: The material that will be discussed is covered by


1. Bahrami A., "Object Oriented System Development", McGraw Hill, 2003. (Part 2, Ch-5 [5.9])
2. Booch G., Rumbaugh J. & Jacobsons I., "The Unified Modeling Language User Guide", Addison Wesley, 2002 (ch-12)
3. Baugh J., Jacobson I. & Booch G., "The unified Modeling Language Reference Manual", Addison Wesley, 1999 (ch-11)

Interface: The material that will be discussed is covered by


4. Bahrami A., "Object Oriented System Development", McGraw Hill, 2003. [Part 2, Ch-5]
5. Booch G., Rumbaugh J. & Jacobsons I., "The Unified Modeling Language User Guide", Addison Wesley, 2002 (ch-11)
Class Diagram
• Shows - set of classes, interfaces, and collaborations and their
relationships
• Models - static design view
• Foundation for – component & deployment diagrams
• Visualizing, specifying & documenting structural models
Class Diagram
• Object modeling – main static analysis diagram
• show the static structure of the model.
• collection of static modeling elements, such as classes and their
relationships, connected as a graph to each other and to their
contents.
• For Ex: the things that exist (such as classes), their internal
structures, and their relationships to other classes.
Class Diagram
• Visibility
Class Diagram
• Binary Association Notation & Association Role
Class Diagram
• Qualifier
• association attribute
Class Diagram …
Class Diagram
• Multiplicity
• lower bound upper bound
• Integer values
Class Diagram
• OR Association
• one of several potential associations may be
instantiated at one time for any single object
• dashed line connecting two or more associations, all
of which must have a class in common – {or}
• A car may associate with a person or a company
Class Diagram
• Association Class
• association that also has class properties
• Notation- a class symbol attached by a dashed line to an
association path
Class Diagram
• N-ary association
Class Diagram
• Aggregation & composition
Generalization
Generalization …
Class Diagram …
• Object diagram – instance of a class diagram
Object diagram …
Object diagram
Packages
• package - a general-purpose mechanism for organizing elements into groups

• Packages themselves may contain other packages

• represented as folder - a large rectangle with a tab attached to its upper left
corner
Class Interface Notation
Interface
Interface
• One class provides services to other classes only through its interfaces

• Interface - a collection of operations that are used to specify a service

• does not specify any structure (attributes) nor any implementation of


the operations
Class Interface Notation
Interface
• Graphically - a stereotyped class

• Names
• simple name
• path name
Interface : name
Interface : Operation
• operations may be adorned with
• visibility properties, stereotypes, tagged values, and constraints
Interface : Operation

Diagrams taken from book-2


Interface : Relationships
• may participate in realization relationships.

• Realization - semantic relationship between two classifiers in which


one classifier specifies a contract that another classifier guarantees to
carry out.

• An interface specifies a contract for a class or a component without


dictating its implementation.
Interface
Constraint
Examples of Class Diagrams
Thank You!

You might also like