IBM Software Group

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

IBM Software Group

Content:
Principle of Visual Modelling Concepts of Object Orientation Use-Case Modeling Object Interaction and Interaction Diagrams Class Diagrams Others

Principle of Visual Modelling


What is modeling? Four principles of visual modeling The UML Process and visual modeling

Why Model?
Modeling achieves four aims:
Helps you to visualize a system as you want it to be. Permits you to specify the structure or behavior of a system. Gives you a template that guides you in constructing a system. Documents the decisions you have made.

You build models of complex systems because you cannot comprehend such a system in its entirety. You build models to better understand the system you are developing.
4

Model Driven Architecture (MDA) Viewpoints


Computational Independent Model (CIM)
Focus is on environment of the system and requirements for the system

Platform Independent Model (PIM)


Focus is on system operation, independent of platform

Platform Specific Model (PSM)


Focus is on detailed usage of system on specific platform

Four Principles of Modeling


The model you create influences how the problem is attacked. Every model may be expressed at different levels of precision. The best models are connected to reality. No single model is sufficient.

What Is the UML?


The UML is a language for
Visualizing Specifying Constructing Documenting

the artifacts of a software-intensive system.

Process and Visual Modeling - What Type of Development Process Most Benefits the UML?
The UML is largely process independent. A process fully benefits from the UML when the process is:
Use-case driven Architecture centric Iterative and incremental

Review
What is a model? What are the viewpoints of MDA? Describe each one. What are the four principles of modeling? Describe each one. What is the UML? Describe each of its four benefits. What process characteristics best fit the UML? Describe each characteristic. What is an iteration?
9

Concepts of Object Orientation


What is an object? Four principles of OO What is a class? Polymorphism and generalization

10

A Formal Definition of Object


An object is an entity with a well-defined boundary and identity that encapsulates state and behavior.
State is represented by attributes and relationships. Behavior is represented by operations, methods, and state machines.
Operations
Attributes

Object

Informally, an object represents an entity, either physical, conceptual, or software.


11

Basic Principles of Object Orientation

Object Orientation

Encapsulation

Abstraction

Modularity

12

Hierarchy

What Is Abstraction?
The essential characteristics of an entity that distinguishes it from all other kinds of entities. Defines a boundary relative to the perspective of the viewer. Is not a concrete manifestation, denotes the ideal essence of something.

13

What Is Encapsulation?
Hides implementation from clients.
Clients depend on interface.

Improves Resiliency
14

What Is Modularity?
Breaks up something complex into manageable pieces. Helps people understand complex systems.

15

What Is Hierarchy?
Increasing abstraction Asset

BankAccount

Security

RealEstate

Decreasing abstraction

Savings

Checking

Stock

Bond

Elements at the same level of the hierarchy should be at the same level of abstraction.
16

What Is a Class?
A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics.
An object is an instance of a class.

A class is an abstraction in that it


Emphasizes relevant characteristics. Suppresses other characteristics.

17

Representing Classes in the UML


A class is represented using a rectangle with three compartments:
The class name The structure (attributes) The behavior (operations)
Professor
- name - employeeID : UniqueId - hireDate - status - discipline - maxLoad + submitFinalGrade() + acceptCourseOffering() + setMaxLoad() + takeSabbatical() + teachClass()

18

What Is Generalization?
A relationship among classes where one class shares the structure and/or behavior of one or more classes. Defines a hierarchy of abstractions in which a subclass inherits from one or more superclasses.
Single inheritance. Multiple inheritance.

Is an is a kind of relationship.

19

What Is Inherited?
A subclass inherits its parents attributes, operations, and relationships. A subclass may:
Add additional attributes, operations, relationships. Redefine inherited operations. (Use caution!)

Common attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchy.
Inheritance leverages the similarities among classes.
20

Use-Case Modeling
Concepts in use-case modeling Use-case diagrams Activity diagrams

21

What Is a Use-Case Model?


A model that describes a systems functional requirements in terms of use cases. A model of the systems intended functions (use cases) and its environment (actors). Major Concepts in Use-Case Modeling: An actor represents anything that interacts with the system. A use case describes a sequence of events, performed by the system, that yields an observable result of value to a particular actor.
22

What Is System Behavior?


System behavior is how a system acts and reacts.
It comprises the actions and activities of a system.

System behavior is captured in use cases.


Use cases describe the interactions between the system (parts of) and its environment.

23

What Is an Actor?
Actors represent roles a user of the system can play. They can represent a human, a machine, or another system. They can actively interchange information with the system. They can be a giver of information. They can be a passive recipient of information. Actors are not part of the system.
Actors are EXTERNAL.

Actor

24

What Is a Use Case?


Defines a set of use-case instances, where each instance is a sequence of actions a system performs that yields an observable result of value to a particular actor.
A use case models a dialogue between one or more actors and the system A use case describes the actions the system takes to deliver something of value to the actor
Use Case

25

How Would You Read This Diagram?


View Report Card

Course Catalog
Register for Courses Maintain Professor Information

Student
Login Maintain Student Information

Registrar
Select Courses to Teach Close Registration

Professor
Submit Grades

Billing System

26

27

What Is an Activity Diagram?


An activity diagram in the use-case model can be used to capture the activities and actions performed in a use case. It is essentially a flow chart, showing flow of control from one activity or action to another.
Flow of Events
This use case starts when the Registrar requests that the system close registration.

1. The system checks to see if registration is in progress. If it is, then a message is displayed to the Registrar and the use case terminates. The Close Registration processing cannot be performed if registration is in progress.
2. For each course offering, the system checks if a professor has signed up to teach the course offering and at least three students have registered. If so, the system commits the course offering for each schedule that contains it.

Activity 2

Activity 1

Activity 3

28

What Is an Activity?
A specification of behavior expressed as a flow of execution via sequencing of subordinate units.
Subordinate units include nested activities and ultimately individual actions.

May contain boolean expression constraints when the activity is invoked or exited
Activity 2 <<Precondition>> Boolean constraint Activity 4

Activity 5
29

<<Postcondition>> Boolean constraint

Example: Activity Diagram


Decision
Select Course

Concurrent Threads
[ add course ]

Activity/Action

[ delete course ]

Delete Course

Synchronization Bar (Fork) Guard Condition


Check Schedule Check Pre-requisites

[ checks completed ]

[ checks failed ]

Synchronization Bar (Join) Transition

Assign to Course Update Schedule

Resolve Conflicts

30

Object interaction and Interaction Diagrams


Objects Need to Collaborate Objects are useless unless they can collaborate to solve a problem. Each object is responsible for its own behavior and status. No one object can carry out every responsibility on its own. How do objects interact with each other? They interact through messages What is an Interaction Diagram? Generic term that applies to several diagrams that emphasize object interactions Sequence Diagram Communication Diagram Specialized Variants Timing Diagram Interaction Overview Diagram 31

What Is a Sequence Diagram?


A sequence diagram is an interaction diagram that emphasizes the time ordering of messages.
:RegisterForCoursesForm :RegistrationController CourseCatalogSystem 1: create schedule( ) : Course Catalog

2: get course offerings( ) 3: get course offerings(for Semester) 4: get course offerings( ) 5: display course offerings( ) 6: display blank schedule( )

ref

Select Offerings
32

What Is a Communication Diagram?


A communication diagram emphasizes the organization of the objects that participate in an interaction. The communication diagram shows:
The objects participating in the interaction. Links between the objects. Messages passed between the objects.

Communication Diagrams
33

Communication Diagram Contents: Links and Messages


Messages

5: display course offerings( ) 6: display blank schedule( )

1: create schedule( ) : RegisterForCoursesForm

Links

: Course Catalog

: Student

2: get course offerings( ) 4: get course offerings( ) 3: get course offerings(forSemester)

Actors

: RegistrationController

: CourseCatalogSystem

34

Sequence and Communication Diagram Differences


Sequence diagrams
Show the explicit sequence of messages Show execution occurrence Better for visualizing overall flow Better for real-time specifications and for complex scenarios

Communication diagrams
Show relationships in addition to interactions Better for visualizing patterns of communication Better for visualizing all of the effects on a given object Easier to use for brainstorming sessions

35

Class Diagrams
Class diagrams Class relationships
Association Aggregation Generalization

36

Example: What Associations Can You Find?


1: submit schedule( ) 2: submit schedule( )

: RegisterForCoursesForm
: Student

: RegistrationController

8: any conflicts?( )

3: save( ) 4: submit( )

: Schedule

7: still open?( ) 9: add student(Schedule)

6: has pre-requisites(CourseOffering)

: CourseOffering : Student
5: is selected?( ) 10: mark as enrolled in( )

: PrimaryScheduleOfferingInfo

37

Example: Multiplicity and Aggregation


1 1 0..1

RegisterForCoursesForm

RegistrationController

0..1 1
Student Schedule

0..*

CourseOffering

0..*

0..4

38

Generalization and Multiple Inheritance


A class can inherit from several other classes.
FlyingThing
Multiple Inheritance

Animal

Airplane

Helicopter

Bird

Wolf

Horse

Use multiple inheritance only when needed and always with caution!
39

UML

() . , , , , . . ( / ) . , , , () .

- , (, ...) ( ) , .
(UML 2.2) , ,
40

UML ()
1. -. 2. (activity) , 3. ( , , , ..) 4. 5. ()
41

, ,

42

43

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy