Itntroduction to UML 1 - PowerPoint PPT Presentation

Loading...

PPT – Itntroduction to UML 1 PowerPoint presentation | free to download - id: 6a7b39-ZmU4M



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Itntroduction to UML 1

Description:

Introduction to UML Part 2 Building blocks of the UML As part of a model you have: 1 modeling elements 2 relationships between the modeling elements 3 diagrams that ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Date added: 2 October 2019
Slides: 52
Provided by: JanPetter1
Learn more at: http://www.te.ugm.ac.id
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Itntroduction to UML 1


1
Introduction to UML Part 2
2
Building blocks of the UML
  • As part of a model you have
  • 1 modeling elements
  • 2 relationships between the modeling elements
  • 3 diagrams that group and visualize the modeling
    elements and the relations between them.
  • E.g. class diagram

3
1 Modeling elements
  • You have modeling elements for
  • 1.1 Structural things
  • 1.2 Behavioral things
  • 1.3 Grouping things
  • 1.4 Annotational things

4
1.1 Structural elements
  • Identified with nouns, e.g. Person Typically
    representing static parts of the model. In UML
    you will find 7 different types of structual
    elements
  • 1.1.1 Class
  • 1.1.2 Interface
  • 1.1.3 Active class
  • 1.1.4 Colloboration
  • 1.1.5 Component
  • 1.1.6 Node
  • 1.1.7 Use Case

5
1.1.1 Class Describes a Set of Objects
6
Encapsulation - Also Called Data Hiding
  • Encapsulation hiding the the implementation of
    the data from users of the object. Users are
    typically objects of other classes. The users
    dont see if the data is stored in fields,
    calculated or if they are retrieved from a
    database, they only call a method.
  • Encapsulation is achieve by never letting objects
    directly access fields. Fields should only be
    accessed through the objects methods.
  • Making the fields private (or protected) ensures
    encapsulation. If you want objects of different
    types to access the fields, then make public
    methods (or package accessibility) for this
    purpose.

7
Operation Versus Method (C member function)
  • A method is an implementation of an operation.
  • A method specifies the algorithm or procedure
  • that produces the results of an operation.

8
1.1.2 Interface A Named Set of Operations That
Describes Some Behavior (No Implementation)
stereotype
interface name
operation compartment
interface - iconic form
interface - expanded form
9
An Interface Can Be Seen As a Protocol
  • An interface is an agreement on behavior.
  • A class which implements an interface agrees on
    supporting the specified behavior.
  • An interface can also be seen as a definition of
    a role, classes which implements the role are
    able to play that role.
  • Example The auto-pilot of an airplane can act as
    a pilot the same is true about some humans. The
    auto-pilot and the human is quit different types
    of objects, but they can both play the same role.
    Many different types of objects can implement the
    interface, so the interface is not the same as a
    class to subclass from.

Interface, HiA by J.P.Nytun 2
10
1.1.3 Active Class
11
1.1.4 Colloboration
12
1.1.5 Component
13
Different types of Components (in UML)
  • Deployment Components this components can be
    assembled to form a complete executable
    system. Example A complete executable
    application, a dynamic library (DLL), a
    JavaBean, a COM object.
  • Work Product Components this components are the
    basis for making the deployment components. They
    are not a part of the executable system, but
    results from the development process. Example
    Source code.
  • Execution Components this components are
    created by an executing system. Example a
    JavaBean created during runtime.

14
Web Example
Working product component
Deployment component
Menu.html
------ ------ ---
Menu.java
Could be an execution component, e.g. Produced by
a servelet
Deployment component
Menu.jpg
15
1.1.6 Node
16
1.1.7 Use Case
17
Extensibility Mechanisms
container EventQueue version 2.1
tagged value
add(eevent) remove(nint) query length()int h
elper function reorder()
add runs in O(1) time
stereotype
constraint
18
1.2 Behavioral Elements
  • Describing the dynamically parts of the model.
    Behavioral elements are identified with the help
    of verbs.
  • 1.2.1 Interaction
  • 1.2.2 State

19
1.2.1 Interaction
Interaction A behavior that comprises a set of
messages sent between a set of objects to archive
a special purpose, like in a sequence diagram.
20
1.2.2 State Machine
State machine A description of the
different states an object can go through in
response to events. Events generated by the
object is also shown. An activity diagram is a
special case of a state diagram.
21
1.3 Grouping Elements
  • You can group elements with the help of packages.
  • 1 A package may own other elements, including
    classes, ..., diagrams, and even other packages.
  • You can use packages to orginaze your classes
    (interfaces,..) and your diagrams.

java
applet
Applet
22
1.4 Annotational Elements
  • You can add comments to a diagram with the help
    of notes.

A comment
23
2 Relations
  • You have 4 different relationships
  • 2.1 Dependency
  • 2.2 Association
  • 2.3 Generalitation
  • 2.4 Realization

24
2.1 Dependency
  • A relationship between to modeling elements,
    indicate that a change in the destination may
    effect the source.

The method add has an employee as argument,
so Company-class (source) is dependent of the
Employee-class (destination).
25
2.2 Association
  • This relationship indicate that there is a
    connection from one type of objects to another
    type. An important type of association is
    aggregation which indicates that one object
    contains objects of a given type.

Company
association name
composition or strong aggregation
1
1..
1..
LocatedAt
Department
Office


multiplicity
ordinary association
26
2.3 Generalization
  • A relationship between a more general element and
    a more specific one. For example a bird is also
    an animal.

27
2.4 Realization
  • UML A semantic relationships between
    classifiers, in which one classifiers specifies a
    contract that another classifier guarantees to
    carry out.

28
3 Diagrams
  • A diagram is typically a view of a part of the
    model, showing modeling elements and some of the
    relationships between them.
  • A diagram do not have to be complete, some
    elements may be missing or presented in a
    simplified fashion.
  • UML A well-formed model is one that is
    semantically self-consistent and in harmony with
    all related models.

29
There are 9 types of diagrams in UML
Dynamic views
Static views
Use Case Diagrams
Sequence Diagrams
Some part of the model might not be visible
on any diagram
Class Diagrams
Collaboration Diagrams
Object Diagrams
Model
Activity Diagrams
Component Diagrams
Statechart Diagrams
Deployment Diagrams
30
3.1 Use case diagram
31
Use Case Diagram - One More Example
A use case is a specific way of using the system
by performing some part of the functionality. Each
use case constitutes a complete course of events
initiated by an actor, and it specifies the
interaction that takes place between an actor
and the system.... I. Jacobson
32
3.2 Class Diagram
responsible for

1
Course
Person
CourseModule
name String description String
name String email
String homePage String
name String description String
tech. responsible for
1..


1
1
1

1

Student

StudentCourseProfile
finished boolean
When a student register for course a
StudentCourseProfile object will be made!
33
A Class Diagram With Navigation

responsible for
1
Course
Person
CourseModule
name String description String
name String imail
String homePage String
name String description String
tech. responsible for
1
1..


1
1



StudentCourseProfile
1
Student
finished boolean
34
A Class Diagram - Mapping to Java
responsible for

1
Course
Person
name String description String
name String imail
String homePage String
tech. responsible for
1

1


StudentCourseProfile
1
Student
finished boolean
public class Person protected String name
protected String imail protected String
homePage // // Navigation protected Course
responsibleFor protected Course
techResponsibleFor public Person()
public class Student extends Person // //
Navigation public StudentCourseProfile
studentCourseProfile
public Student()
35
A Class Diagram - Example With Interface
ltltInterfacegtgt
IStorable
Register
-reg
edit()
0..
0..
write()
read()
relization
Person
public void read()
terminal.print("Name ")
name terminal.readLine()
edit()
...
write()

read()
relization/implements
To different representation of nearly the same
dependency
36
A Class Diagram - One More Example With Interface
37
3.3 Object Diagram - Capture Instances and Links
Class
Object
Company
HiA Company noOfEmploees600
Possible object
noOfEmploees int
name
object class
attribute with value
38
Object Diagram with Links
Class Diagram
Object Diagram
Language Department
Gimlemoen Office
LocatedAt
HiA Company
Possible object diagram
Engineering Department
Grooseveien Office
LocatedAt
Link - A link is an instance of an
association, analogous to an object being an
instance of a class.
39
Object diagram and Rational Rose 2000
Rational Rose 2000 does not have object
diagrams, but you can achieve much the same with
a collobartion diagram
You can not specify attributes inside object One
solution to this short-coming is to use a comment!
40
3.4 Sequence diagram
41
3.5 Colloboration diagram
1.3 setDate(data)
person
user
controllerViewer
register
42
3.6 Statechart diagram
StateChart for microwave oven "control unit"
43
Statechart for Applet
init/init()
stop/ stop()
start /start()
start/start()
44
3.7 Activity diagram - Capture Dynamic Behaviour
(Activity-oriented)
45
Activity diagram - One More Example
activity
product of activity
46
Activity diagram - One More Example
user
controller
register
person
request registration
create person (object)
supply person-data
forward person-data
process person-data
insert person
47
3.8 Component diagram - Captures the Physical
Structure of the Implementation
48
Component diagram - One More Example
ISortable
49
3.9 Deployment diagram
Extended VLAN
network LAN
50
Multi-tier Architecture - MVC
- view browser/jsp/servlet controller jsp/servle
t model businessObjects
client
Internet
server1
Intranet
server2
51
References
  • 1 Grady Booch, James Rumbaugh and Ivar
    Jacobson The Unified Modeling Language User
    Guide. Addison-Wesley, 1999
  • James Rumbaugh, Michael Blaha, William
    Premerlani, Frederick Eddy and William Lorenzen
    Object-Oriented Modeling and Design. Prentice
    Hall, 1991
  • Martin Fowler with Kendall Scott UML
    Distilled. Addison-Wesley, 1997
  • Terry Quatrani Visual Modeling with Rational
    Rose and UML. Addison-Wesley, 1998
  • Ari Jaaksi A Method for Your First
    Object-Oriented Project. JOOP - The Journal of
    Object-Oriented Programming, Januar 1998
  • Rational software http//www.rational.com/uml/do
    cumentation.html
About PowerShow.com