uml unified modeling language. what is uml? unified modeling language (uml) is a standardized,...

22
UML Unified Modeling Language

Upload: lily-owen

Post on 11-Jan-2016

262 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

UMLUnified Modeling Language

Page 2: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

What is UML?

• Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software engineering.

• The Unified Modeling Language includes a set of graphic notation techniques to create visual models of object-oriented software-intensive systems.

Page 3: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

• UML diagrams represent two different views of a system model

1. Static (or structural) view:It emphasizes on the static structure of the system using objects, attributes, operations and relationships.2. Dynamic (or behavioral) view:It emphasizes on the dynamic behavior of the system by showing collaborations among objects and changes to the internal states of objects.

Page 4: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software
Page 5: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Class Diagram

• The class diagram is the main building block of object oriented modeling.

• It is used both for general conceptual modeling of the systematics of the application and for detailed modeling translating the models into programming code.

• Class diagrams can also be used for data modeling.

Page 6: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Components of Class Diagram

• Class or Entity• Relationship/Association• Attributes

Page 7: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Classes

• The classes in a class diagram represent both the main objects, interactions in the application and the classes to be programmed.

• In the diagram, classes are represented with boxes which contain three parts:

1. The upper part holds the name of the class2. The middle part contains the attributes of the

class3. The bottom part gives the methods or operations the class can take or undertake

Page 8: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software
Page 9: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Relationships or Association

• An association represents a family of links.• Binary associations (with two ends) are

normally represented as a line.• An association can be named, and the ends of

an association can be adorned with role names, ownership indicators, multiplicity, visibility, and other properties.

Page 10: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

• There are four different types of association: bi-directional, uni-directional, Aggregation (includes Composition aggregation) and Reflexive.

• Bi-directional and uni-directional associations are the most common.

Page 11: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Aggregation

• Aggregation is a variant of the "has a" or association relationship; aggregation is more specific than association.

• It is an association that represents a part-whole or part-of relationship.

• Aggregation can occur when a class is a collection or container of other classes, but where the contained classes do not have a strong life cycle dependency on the container—essentially, if the container is destroyed, its contents are not.

Page 12: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software
Page 13: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Composition

• Composition is a stronger variant of the "owns a" or association relationship; composition is more specific than aggregation.

• Composition usually has a strong life cycle dependency between instances of the container class and instances of the contained class(es): If the container is destroyed, normally every instance that it contains is destroyed as well

Page 14: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software
Page 15: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Multiplicity

0..1 No instances, or one instance (optional, may)

1 Exactly one instance

0..* or * Zero or more instances

1..* One or more instances (at least one)

Page 16: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Generalization• The Generalization relationship ("is a")

indicates that one of the two related classes (the subclass) is considered to be a specialized form of the other (the super type) and superclass is considered as 'Generalization' of subclass.

Page 17: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software
Page 18: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Tables and Columns

• A table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows, the cell being the unit where a row and column intersect.

• An attribute(Column) is a specification that defines a property of a table.

Page 19: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Keys

• In an entity relationship diagram of a data model, one or more unique keys may be declared for each data entity. Each unique key is composed from one or more data attributes of that data entity.

• In a relational database, a "Primary Key" is a key that uniquely defines the characteristics of each row (also known as record or tuple).

• A table can have at most one primary key, but more than one unique key.

Page 20: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Primary Key Stereotype

• We can Indicate a primary key in a table using <<PK>> stereotype.

• Which looks something like this

Page 21: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Summary

• Class Names = Table Names in UML

• Object Names = Attribute/Column Names in UML

• Use association to indicate relation between tables

• Use <<PK>> Stereotype to indicate primary key.

Page 22: UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software

Example :Creating UML Class Diagramusing Star UML