java academy introduction to uml

24
7/28/2019 Java Academy Introduction to UML http://slidepdf.com/reader/full/java-academy-introduction-to-uml 1/24 Introduction to UML Java Center of Excellence

Upload: sreenivas-reddy-g

Post on 03-Apr-2018

233 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 1/24

Introduction to UML

Java Center of Excellence

Page 2: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 2/24

2 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Objectives

• Understand the basics of Unified ModelingLanguage (UML)

• Understand the commonly used UML diagrams

Page 3: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 3/24

3 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

 Your Expectations

Page 4: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 4/24

4 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Expectations

• Covered

– Basics of UML

– Commonly used UML Diagrams

• Not Covered– Modeling languages

– Detailed UML

– All UML Diagrams

Page 5: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 5/24

5 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

 Agenda

• Modeling• Unified Modeling Language

• UML Diagrams

– Class Diagram

– Sequence Diagram– State Diagram

Page 6: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 6/24

6 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Modeling Language

• Model– A model is a simplification of reality

– We build models so that we can better understand thesystem we are developing

– We build models of complex systems because we cannotcomprehend such a system in its entirety

• Mental Model

– Mental models are assumptions, generalizations, andimages.

– Mental Models must be questioned and communicated toensure that they are relevant and understood

– Communication must be based on a common language

• A Modeling Language helps to express MentalModels in a certain syntax

Page 7: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 7/247 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Unified Modeling Language

• Unified Modeling Language is the language ornotation used to convey ideas in both the problemdomain (analysis) and the solution domain (design)

• Goals– To achieve uniform communication method for all

stakeholders

– To adress the issues of managing complex, mission-criticalsystems

– To model systems, from concept to executable artifact,using object-oriented techniques

Page 8: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 8/248 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Why UML?

• Standardized graphical notation for– Specifying, visualizing, constructing, and documentingsoftware systems

• Language can be used from general initial design tovery specific detailed design

• Increase understanding/communication of productto customers and developers

• Support for UML in many software packages today(e.g. Rational, Together J, Visio)

Page 9: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 9/249 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

UML Diagrams

• UML Diagrams are divided into two differentviews of a system model

– Structural: Emphasize the static structure of thesystems using objects, attributes, operations andrelationships

– Behavioral: Emphasize on the dynamic behavior of thesystem by showing collaborations among objects andchanged to their states

Page 10: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 10/2410 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

UML Diagrams

• Structural– Class Diagram

– Component & Deployment Diagram

• Behavior– Activity Diagram

– Use Case Diagram

– Interaction Diagram

►Sequence Diagram

– State Machine Diagram

Page 11: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 11/2411 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Class Diagram

• Main Building block of Object OrientedProgramming

• Represents the objects in the system and therelationships amongst them

• Classes are represented by a box having threesections

– Upper part holds the name of the Class

– Middle part holds the attributes or properties

– Bottom part holds the operations or functions

Page 12: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 12/2412 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Class Diagram: Members

• Visibility– + denotes a public member

– # denotes a protected member

– - denotes a private member

– ~ denotes a package member

• Scope

– Instance: Refers to members and their values that arespecific to every instance of the object

– Classifier: Refers to members and their values that arecommon to all instance

►Static members in a class

Page 13: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 13/2413 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Class Diagram: Instance Relationships

• Association– An association represents a family of links

– Can be named indicating the roles

– Is represented by a line between two objects

Page 14: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 14/2414 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Class Diagram: Instance Relationships

• Aggregation– It is a variant of a “has a” or association relationship 

– More specific that an association; extends all thecharacteristics of an association

– Represents a “part-whole” relationship 

– Represents that the contained classes do not have alifecycle dependency on the parent

► If the container is destroyed the contents are notdestroyed

– It is graphically represented by a hollow diamond on the

containing class end of the relationship

Page 15: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 15/2415 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Class Diagram: Instance Relationships

• Composition– It is a variant of a “owns a” or association relationship 

– More specific that an aggregation; extends all thecharacteristics of an association

– Represents that the contained classes have a a lifecycle

dependency on the parent► If the container is destroyed the contents are also

destroyed

– It is graphically represented by a solid diamond on thecontaining class end of the relationship

Page 16: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 16/2416 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Class Diagram: Class Relationships

• Generalization– Indicates that the sub-type is considered to be a

specialized form of the super-type

– Super-type is considered as the “Generalization” of sub-type

►Sub-type is considered as the “Specialization” of the super-type

– It is graphically represented by a hollow triangle on thesuper-type

Page 17: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 17/2417 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Class Diagram: Class Relationships

• Realization– Indicates a relationship between two model elements,where the client realizes the behavior of the supplier

– It depicts a relationship between classes, interfaces,components and packages

<<interface>>TypeWriter 

ctl()

pageDown()

brandNamenumOfKeys

Keyboard

keyStroke()

Page 18: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 18/2418 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Class Diagram: General Relationships

• Dependency– Indicates a weaker form of relationship

– Indicates that a class uses another class at a point of time

– Exists if a contained class exists as a parameter or a

local variable in the container class– Is graphically represented by dotted line ending with an

arrow on the class that is contained or is used

Page 19: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 19/2419 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Class Diagram: General Relationships

• Multiplicity– Relationships indicate that two classes make a referenceto each other

– Multiplicity helps in identification of multiplicityrelationship of instances

– Common Multiplicities are► 0..1

► 1

► 0..* or *

► 1..*

Page 20: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 20/2420 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Sequence Diagram

• A type of Interaction Diagram• Describes how a process operates between

objects and in what order

• Represented by

– Parallel Vertical Lines depict object lifelines– Horizontal Lines depict messages transferred between

objects

Page 21: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 21/2421 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

Sequence Diagram

Page 22: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 22/2422 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

State Machine Diagram

• Provide an abstract description of behavior of asystem– Behavior is represented in a series of events that can

occur in one or many states

• Each diagram represents an object of a single

Class, tracking different states• Represented by

– States are represented as rounded rectangles, labeledwith names

– Transitions are represented by arrows, labeled with

events triggering the transition– Initial State is represented by Solid Circle

– Final State is represented by a Solid Circle inside of ahollow circle

Page 23: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 23/2423 Any use, copying or distribution without written permission from UnitedHealth Group is prohibited.

State Machine Diagram

Page 24: Java Academy Introduction to UML

7/28/2019 Java Academy Introduction to UML

http://slidepdf.com/reader/full/java-academy-introduction-to-uml 24/24

Questions