Document 13449718

advertisement
2001-09-13
/BJECT/RIENTED !NALYSIS AND $ESIGN
WITH 5-,
$R 5WE !SSMANN
0%,!" )$!
#ONTENTS
w
w
w
w
-ODELLING IN !NALYSIS UND $ESIGN
&UNCTIONAL -ODEL
3TATIC -ODEL 3TRUCTURAL MODEL OBJECT MODEL
n
2EARRANGING THE STATIC MODEL
$YNAMIC -ODEL "EHAVIORAL -ODEL
1
2001-09-13
7HAT IS /BJECT/RIENTED -ODELING
/BJECT/RIENTATION AS A $ESIGN -ETHOD
w
3O FAR WE HAD DESIGN METHODS
n
w
0ARNAS
-ODULAR DESIGN
//$EVELOPMENT IS A $ESIGN -ETHOD
n
.OTATION 5-,
n
0ROCESS DIFFERENT
w
w
w
)NFORMATION (IDING
n
2ATIONAL 5NIFIED 0ROCESS
5SE#ASE $RIVEN 0ROCESS WITH /BJECT/RIENTED !NALYSIS
(EURISTICS
//$EVELOPMENT MODELS 2
2001-09-13
-ODELING 7HAT
w
w
w
4HE WORLD !NALYSIS
n
7(!4
n
PROB LEMSS 0ROBLEM !NALYSIS 0ROBLEM 3PEZIFIKATION
n
2EQUIREMENTS
n
3YSTEMS OF THE REAL WORLD 3IMULATION
n
/BJECT/RIENTED !NALYSIS //!
3OFTWARE SYSTEMS $ESIGN
n
7(!4 (/7
n
/BJECT/RIENTED $ESIGN //$
THEN
)MPLEMENTATION
n
7(!4 (/7 "9 7(!4 (/7 '//$
n
/BJECT/RIENTED IMPLEMENTATION //0
-ODELING THE REAL WORLD
Car
...
1
4
Wheel
Engine
2
Side-wheels
3
2001-09-13
!NALYSIS VS $ESIGN
w
w
w
!NALYSIS IS DRIVEN OF THE PROBLEM DOMAIN )E THE REAL WORLD
n
)NTEGRATES CONSTRAINTS OF THE PROBLEM
$ESIGN IS DRIVEN BY THE SOLUTION DOMAIN
n
)NTEGRATES CONSTRAINTS OF THE IMPLEMENTATION
n
$ESIGN SHOULD BE REUSE DRIVEN
n
$ESIGN TREATS PARTS OF THE (/7 AND "9 7(!4 THE REST IS DONE BY THE
IMPLEMENTATION
'OOD DESIGN
n
#AN BE MEASURED METRICS
n
2ESULTS OF BEST PRACTICES HEURISTICS DESIGN PATTERNS
n
)MPOSES AN ARCHITECTURAL STYLE TO A SYSTEM
// !NALYSIS VS // $ESIGN
w
w
w
w
3O // $EVELOPMENT CONSIDERS BOTH PROBLEMS AND SOLUTIONS AS
COMPOSED OF OBJECTS AND THEIR RELATIONS
"OTH //! AND //$ USE // -ODELLING
$IFFERENT 2ELATIONS BETWEEN !NALYSIS AND $ESIGN
n
n
n
!NALYSIS $ESIGN IN SIMPLE CASES
!NALYSIS IS $ESIGN IN REENGINEERING
/THERWISE !NALYSIS MODEL IS EVOLVED TO $ESIGN MODEL
)N ALL CASES
n
n
3TRUCTURAL MODEL STATIC MODEL ARCHITECTURAL MODEL
w
w
#LASS MODEL
/BJECT MODEL
"EHAVIORAL MODEL DYNAMIC MODEL AS A MODELING OF FUNCTIONAL AND
BEHAVIORAL ASPECTS
w
n
STATE CHARTS INTERACTION AND SEQUENCE DIAGRAMS
&UNCTIONAL MODEL
w
w
USE CASES
/FTEN THE FUNCTIONAL MODEL IS CONSIDERED PART OF THE BEHAVIORAL MODEL
4
2001-09-13
4HE #LASSIC // 3OFTWARE 0ROCESS
"EHAVIOR
3TRUCTURE
Object-Oriented
Analysis OOA
(prob lems und
requirements)
object model
dynamic model
object model
Object-Oriented
Design OOD
dynamic model
object e
Object-Oriented
implementation
OOP
behavior
More details, less freedom and variability
/BJECT/RIENTED -ODELLING
w
w
3TATIC -ODEL DESCRIBES 3TRUCTURE
n
/BJECTS THEIR CLASSES ASSOCIATIONS RELATIONS INHERITANCE
n
0ACKAGING SUBSYSTEMS
$YNAMIC -ODEL SHOWS BEHAVIOR AND FUNCTION
n
5SE CASES DESCRIBE USES AND FUNCTIONS
n
)NTERACTION SEQUENCE DIAGRAMS SHOW COLLABORATIONS BETWEEN OBJECTS
n
3TATECHARTS DESCRIBE HOW AN OBJECT REACTS ON EVENTS MESSAGES
5
2001-09-13
/THER !SPECTS
ARCHITECTURE
Object-Oriented
Analysis OOA
(problems und
requirements)
BEHAVIOR
persistence
object model
parallelism
distribution
dynamic model
persistence
object model
parallelism
Object-Oriented
Design OOD
distribution
dynamic model
persistence
object e
Object-Oriented
implementation
OOP
parallelism
distribution
behavior
3YSTEM $ESIGN
w
4RADITIONAL MODULAR DECOMPOSITION
n
$EVELOP HIERARCHIES
n
$ECOMPOSE SYSTEM
DATA AND PROCEDURES
w
/BJECT/RIENTED DECOMPOSITION
n
"ETTER -ODULARITY BY ENCAPSULATION
IN OBJECTS
n
$YNAMIC ARCHITECTURES DUE TO
POLYMORPHISM
6
2001-09-13
/BJECT/RIENTED -ODELING WITH 5-,
)N ANALYSIS AND DESIGN
// -ODELLING
$ERIVE
.OUN6ERB
5SE#ASES
!NALYSIS
;/K=
3TRUCTURAL
-ODEL
$YNAMIC
-ODEL
7
2001-09-13
&UNCTIONAL -ODEL WITH 5SE #ASES
/FTEN IS CONSIDERED TO BE PART OF THE DYNAMIC MODEL
5SE #ASE $IAGRAM
w
w
w
! 5SE #ASE $IAGRAM CONSISTS OF SEVERAL USE CASES OF A SYSTEM
! USE CASE DESCRIBES AN APPLICATION A COARSEGRAIN FUNCTION OF A
SYSTEM IN A CERTAIN RELATION WITH ACTORS
! USE CASE CONTAINS A SCENARIO SKETCH
n
w
0SEUDOCODE TEXT WHICH DESCRIBES THE FUNCTIONALITY
5SE CASES ARE GOOD FOR
n
$OCUMENTATION
n
#OMMUNICATION WITH CUSTOMERS AND DESIGNERS
n
!RE STARTED FOR THE FIRST LAYOUT OF THE STRUCTURAL MODEL
n
3OMETIMES CALLED
STORIES
WHICH SHOULD FIT ON ONE MUDDY CARD 80
8
2001-09-13
1UESTIONS FOR 5SE #ASES
w
w
7HAT IS
n
! USER
w
w
w
w
w
THE SYSTEMSUBSYSTEM
7HO IS !CTOR
n
!N ACTIVE OBJECT
! PERSON
! SYSTEM
-UST BE EXTERNAL TO THE DESCRIBED SYSTEM
7HAT ARE THE !PPLICATIONS5SES
7HAT ARE THE RELATIONS AMONG 5SE #ASES
n
%XTENDS %XTEND AN EXISTING USE CASE )NHERITANCE
n
5SES 2EUSE OF AN EXISTING USE CASE 3HARING
%XAMPLE 3ERVICE 3TATION
w
! 3ERVICE 3TATION HAS TASKS
n
0ARKING
n
2EFUELING
n
-AINTENANCE
n
0REVENTIVE -AINTAINANCE
0ARKING
2EFUELING
#USTOMER
-AINTENANCE
-ANAGER
0REVENTIVE
-AINTENANCE
9
2001-09-13
1UESTIONS TO HELP
w
w
w
w
7HAT
n
5SERS
n
%XTERNAL SYSTEMS
n
USE
n
.EED
THE SYSTEM FOR WHICH TASKS
!RE TASKS OR RELATIONS TO COMPLEX
2EFINEMENT 3ERVICE 3TATION
w
7E INTRODUCE AN ABSTRACTION OF
THE SERVICES
#REDIT #ARD
3YSTEM
-ANAGER
"ILLING
3ERVICES
#USTOMER
-AINTENANCE
0ARKING
2EFUELING
10
2001-09-13
3ECOND 2EFINEMENT 3ERVICE 3TATION
w
7E INTRODUCE AN ABSTRACTION OF
THE SERVICES
#REDIT #ARD
#USTOMER
3YSTEM
"ILLING
3ERVICES
0RINTER
3YSTEM
!CCOUNTING
3ERVICES
-AINTENANCE
0ARKING
2EFUELING
-ANAGER
#HECK ,IST 5SE #ASE $IAGRAM
w
w
w
w
w
#LARITY
3IMPLICITY
#OMPLETENESS
-ATCH THE STORIES OF THE CUSTOMER
-ISSING ACTORS
11
2001-09-13
3TATIC -ODEL 3TRUCTURAL -ODEL /BJECT
-ODEL
3TATIC -ODEL 3TRUCTURAL -ODEL /BJECT
-ODEL
w
w
w
3IMPLE FORM OF
ARCHITECTURAL DESCRIPTION
/N #LASSES
n
4YPES
n
3ETS OF OBJECTS
0ACKAGES
n
'ROUPS OF CLASSES
n
3UBSYSTEMS
12
2001-09-13
(IERARCHICAL 3YSTEM $ECOMPOSITION
Car
Body Work
Engine
Cylinder
Injection Nozzle
Dynamo
Wheels
Lights
Spark Plug
Piston
Rear Lights
Front Lights
Can be done with Classes (HOOD, not UML) or Packages (UML)
1UESTIONS TO &IND THE 3TATIC -ODEL
w
w
w
w
w
w
7HICH OBJECTS DO WE NEED
n
-AY BE DERIVED FROM ACTORS AND TASKS IN USE CASES
7HICH FEATURES DO THEY HAVE
(OW CAN THE OBJECTS BE CLASSIFIED
n
7HICH CLASSES
n
7HICH GENERIC CLASSES
(OW ARE THE OBJECTS USED
n
2ELATIONS TO OTHERS
n
#OLLABORATIONS WITH OTHERS
7HICH ACTIONS ARE PERFORMED BY THE OBJECTS
)N WHICH STATES ARE THE OBJECTS AND WHEN DO THEY CHANGE THEM
13
2001-09-13
(OW TO FIND /BJECTS AND #LASSES
w
$ESIGN WITH
n
w
w
RESPONSIBILITIES
!SK THE QUESTION
w
7HICH OBJECT IS RESPONSIBLE
FOR WHICH TASK
5SE .OUN6ERB!NALYSIS
n
7HO IS INVOLVED
n
7HAT DOES IT DO
0RINCIPLE OF 2ESPONSIBILITYBASED //$
n
%VERY OBJECT IS RESPONSIBLE FOR CERTAIN TASKS
n
%ITHER IT HAS ALL THE CAPABILITIES TO DO THE JOB ITSELF OR
n
)T COOPERATES WITH OTHERS TO ACHIEVE THE TASK
#LASS 2ESPONSIBILITY #ARDS #2#
w
&IX THE ROLE AN OBJECT HAS IN THE SYSTEM
n
2ESPONSIBILITIES
n
#OOPERATION PARTNERS
Class Name
#OOPERATION WITH
2ESPONSIBLE FOR
14
2001-09-13
Student
#OOPERATING WITH
2ESPONSIBLE FOR
order
Accept paket
Parcel Service
#OOPERATING WITH
2ESPONSIBLE FOR
Accept paket
Deliver paket
Computer Dealer
Parcel Service
Computer Dealer
#OOPERATING WITH
2ESPONSIBLE FOR
Computer Dealer
Student
Accept Order
Deliver paket
Student
Parcel Service
.OUN6ERB!NALYSIS
w
w
w
w
w
!NALYZE 5SE #ASE $IAGRAMS OR 2EQUIREMENTS 3PECIFICATION
&IND OBJECTS BY
n
NOUNS AND SUBJECTS
&IND COOPERATIONS FORM
n
3UBJECTOBJECT RELATIONS
n
GENITIVS
&IND ACTIVITIES FROM
n
6ERBS
n
3UBSTANTIVATED VERBS
%XAMPLE
n
DRIVER TURNS ON THE LIGHTS THE BATTERY IS DISCHARGED
ENGINE RUNS THE DYNAMO RECHARGES THE BATTERY
7HEN THE
7HEN THE
15
2001-09-13
/UR &IRST #LASS $IAGRAM
3TUDENT
ORDER
ACCEPT0AKET
#OMPUTER $EALER
0ARCEL 3ERVICE
ACCEPT/RDER
DELIVER0AKET
ACCEPT0AKET
DELIVER0AKET
-ODELING THE REAL SOLUTION
Prototype of a
washing machine
&IND THE RIGHT ABSTRACTIONS
16
2001-09-13
4HE "ASIC ,AWS OF -ISUNDERSTANDING
3POKEN IS NOT HEARD
(EARD IS NOT LISTENED
,ISTENED IS NOT UNDERSTOOD
5NDERSTOOD IS NOT ACCEPTED
!CCEPTED IS NOT DONE
3PECIAL -ALE&EMALE )NSTANCE
7HEN DID YOU DESIGN
FOR THE LAST TIME
THE DREAMS OF YOUR WIFE
17
2001-09-13
!RRANGING THE 3TRUCTURAL -ODEL WITH
/PERATIONS ON #LASSES
2ESTRUCTURING OF 3TRUCTURAL -ODEL
w
w
w
w
&ACTOR OUT COMMONALITIES
n
INTO SUPER CLASSES
n
INTO GENERIC CLASSES
n
INTO DELEGATED CLASSES
3EPARATE VARIABILITIES DIFFERENCES
n
INTO SUBCLASSES
n
INTO 4YPE PARAMETERS OF GENERIC CLASSES
n
IN DELEGIERTE CLASSES
'OAL PRODUCT FAMILIES FRAMEWORKS
n
4HEIR COMMON CODE WORKS FOR ALL PRODUCTS IN THE FAMILY
n
REALIZED BY POLYMORPHISM
(OLLYWOOD 0RINCIPLE $ONT CALL US WE CALL YOU
n
/LD CODE CAN CALL NEW CODE
n
&RAMEWORK CLASSES CAN CALL USERBASED EXTENSIONS
18
2001-09-13
!BSTRACT CLASSES
w
!BSTRACT CLASSES ARE BETWEEN CLASSES UND TYPES
n
w
w
!T LEAST ONE METHOD IS NOT IMPLEMENTED IE ONLY AN INTERFACE
ABSTRACT METHOD METHOD SIGNATURE
#ANNOT BE INSTANTIATED TO OBJECTS
n
"UT USED FOR INHERITANCE
)NTERFACES ARE FULLY ABSTRACT CLASSES
n
$EFINE A TYPE
n
$EFINE A SERVICE FOR A CLASS TO WHICH THEY ARE INHERITED
n
/NLY CONSIST OF METHOD SIGNATURES
!BSTRACT #LASSES AND )NTERFACES IN 5-,
ABSTRACT CLASS
0ERSON
INTERFACE
0ERSON
%AT
$RINK
%AT
$RINK
7ORK
3LEEP
IMPLEMENTATION CLASS
0ERSON
7ORK
3LEEP
%AT
TYPE
$RINK
0ERSON
7ORK
3LEEP
%AT
$RINK
7ORK
3LEEP
TYPE UND INTERFACE ARE
STEREOTYPES
4HESE ARE SPECIFIC CLASSES MARKED
FOR A SPECIFIC PURPOSE
3TEREOTYPES ARE USED TO
EXTEND 5-,
19
2001-09-13
3INGLE AND -ULTIPLE )NHERITANCE
w
3INGLE )NHERITANCE
n
%VERY CLASS HAS AT MOST ONE SUPER CLASS FROM WHICH IT INHERITS FEATURES
COMMON WITH BROTHERS AND SISTERS
w
n
4HE INHERITANCE RELATION IS A TREE
-ULTIPLE )NHERITANCE
n
3EVERAL SUPER CLASSES POSSIBLE
n
)NHERITANCE RELATION IS A DIRECTED ACYCLIC GRAPH DAG PARTIAL ORDER
n
#LASS MAY INHERIT A FEATURE WITH THE SAME NAME TWICE
3INGLE )NHERITANCE
0ERSON
GET.AME
0ROFESSOR
3TUDENT
GET,ECTURE
DRINK"EER
3UPER CLASS 3 CONTAINS COMMON FEATURES FOR ALL SUBCLASSES
20
2001-09-13
&EATURE 2ESOLUTION IN -ULTIPLE )NHERITANCE
-2/
!
P
"
P
&ROM WHERE IS P INHERITED
-2/ -ETHOD2ESOLUTION/RDER
$YNAMIC !RCHITECTURE WITH )NHERITANCE
AND 0OLYMORPHISM
#ALLER
CALLS
3UPER#LASS
P
#ALLER [
IF [
!
"
P
P
3UPER#LASS OBJ NEW "
] ELSE [
3UPER#LASS OBJ NEW !
]
OBJP
]
#OMMON CODE IN THE CALLER
NEED NOT KNOW WHICH
/BJECT OF WHICH SUBTYPE IS
#
P
21
2001-09-13
)NHERITANCE %VALUATION
2EUSE EASY
7ITH FEW EFFORT NEW SPECIALIZED CLASSES CAN BE BUILT
%ASY #HANGE 0ROPAGATION
#HANGES IMPACT THE WHOLE SUBCLASS TREE
$YNAMIC ARCHITECTURES WITH EXCHANGE OF SUBCLASS OBJECTS POLYMORPH
6IOLATION OF INFORMATION HIDING
n
3UBCLASSES KNOW TOO MUCH ABOUT SUPER CLASSES INVALIDATING SUPER CLASS
CODE IS EASY
&RAGILE BASE CLASS PROBLEM #HANGES OF SUPER CLASSES LEAD MAY TO
INVALIDATION OF SUB CLASSES
"AD READABILITY
4O UNDERSTAND A CLASS ALL SUPER CLASSES MUST BE UNDERSTOOD
)NHERITANCE DOES NOT ENSURE SUBSTITUTABILITY PRODUCT FAMILIES ARE NOT
EASY
!N OBJECT MAY DELEGATE
$ELEGATION
A TASK TO ANOTHER OBJECT
$ELEGATING CLASS
DELEGATOR
#
(AS?A
DELEGATED CLASS
DELEGATEE
$
F
F
RETURN DF
!DAPTER METHOD F
22
2001-09-13
%VALUATION OF $ELEGATION
w
w
$ELEGATION SIMULATE
n
3IMPLE AND -ULTIPLE )NHERITANCE
n
'ENERICITY
$ELEGATION CREATES
n
OBJECT SCHIZOPHRENIA
)F DELEGATEE AND DELEGATOR BELONG LOGICALLY TOGETHER THEY ARE
PHYSICALLY DIFFERENT
n
7HAT HAPPENS IF DELEGATEE CALLS
self 7HO
IS MEANT
7HAT S THAT
λ TYPE CLASS 3ET [
]
BOOLEAN CONTAINSTYPE ELEMENT
INSERTTYPE ELEMENT
REMOVETYPE ELEMENT
APPLE3ET 3ET!PPLE
BANANA3ET 3ET"ANANA
23
2001-09-13
'ENERIC #LASSES
w
w
! CLASS TEMPLATE IS TO BE BOULD BY A TYPE PARAMETER
.OTATION IN 'ENERIC *AVA
CLASS 3ETTYPE [
BOOLEAN CONTAINSTYPE ELEMENT
INSERTTYPE ELEMENT
REMOVETYPE ELEMENT
]
3ET!PPLE APPLE3ET NEW 3ET!PPLE
3ET"ANANA BANANA3ET APPLE3ET 72/.'
'ENERIC #LASSES
w
w
w
&OR ALGORITHMIC SCHEMATA
n
#OMMEN SCHEMA IS IN THE GENERIC CLASS
n
6ARIABLE BEHAVIOR IS IN THE TYPE PARAMETER
/FTEN USED FOR CONTAINER
n
,ISTS SETS TREES GRAPHS
"ETTER TYPE CHECK
24
2001-09-13
'ENERIC #LASSES IN 5-,
w
)N 'ENERIC *AVA
w
"INDING
PUBLIC CLASS 3ET4 [
]
4
3ET
3ET)NTEGER S
3ET0OINT S
BIND0OINT
3ET0OINT
3ET)NTEGER
3TRUCTURE $IAGRAM 3ERVICE 3TATION
0URCHASE
3ERVICES
#USTOMER
0ARKING
2EFUEL
-AINTENANCE
&UEL
0ART
)NVENTORY
25
2001-09-13
/BJECTS #LASSES -ETA #LASSES
w
w
w
-ETA DATA DESCRIBES DATA
! CLASS CAN BE CONSIDERED AS AN OBJECT OF THE META LEVEL BECAUSE IT
DESCRIBES AN OBJECT ON THE BASE LEVEL
! META CLASS DESCRIBES A CLASS AND IS PART OF THE META MODEL
/BJECT
#LASS
-ETACLASS
0ETER0ERSON
0ERSON
#LASS
0ERSON#LASS
$ELEGATE
%AT
)NHERIT
$RINK
%XTEND
7ORK
)NSTANTIATATE
3LEEP
MODEL
WORLD
-ETA MODEL
-ETA -ODEL OF 5-,
3TRUCTURE $IAGRAM
(AS?A
)NTERFACE
#LASS!,IKE
&EATURE
'ENERIC#LASS
!BSTRACT#LASS
!TTRIBUTE
#LASS
-ETHOD
4HE 5-, META MODEL DESCRIBES 5-, )T CONTAINS ALL CONCEPTS OF 5-,
AS CLASSES
!LSO STEREOTYPES ARE DESCRIBED AS CLASSES
3OME STEREOTYPES ARE PREDEFINED
)E )NTERFACE !BSTRACT#LASS 'ENERIC#LASS #LASS ARE STANDARD CLASSES
IN THE META MODEL OF 5-,
5SERDEFINED STEREOTYPES ARE CONSIDERED AS EXTENSIONS OF THE 5-,
META MODEL
26
2001-09-13
0ACKAGE $IAGRAMS
w
w
w
0ACKAGES ARE SUBSYSTEMS AND ALLOW TO STRUCTURE THE CLASSES
0ACKAGES REPRESENT AN ELEMENT OF THE MODULAR DESIGN IN THE
OBJECTORIENTED NOTATION 5-,
0ACKAGE RELATIONS SHOULD BE ACYCLIC
n
3IMILAR TO THE USES RELATION IN LAYERED SYSTEMS
%XAMPLE 0ACKAGES 3ERVICE 3TATION
3ERVICES
#USTOMERS
0URCHASE
0ARKING
2EFUEL
#USTOMER
3ERVICES
-AINTENANCE
&UEL
0ART
)NVENTORY
27
2001-09-13
(OWEVER #OPLIEN S ,AW ON 3OFTWARE
3TRUCTURE
3OFTWARE IS ALWAYS STRUCTURED IN THE SAME WAY AS
THE ORGANISATION WHICH BUILT IT
$YNAMIC -ODEL "EHAVIORAL -ODEL
28
2001-09-13
$IAGRAMS FOR $YNAMIC 3CENARIOS
w
w
w
3EQUENCE DIAGRAM
n
3EQUENCE OF MESSAGES OVER TIME
n
/BJECT
LIFE LINES
#OLLABORATION DIAGRAM
n
.UMBERING OF MESSAGES OVER TIME
3TATECHART
n
.ESTED FINITE AUTOMATA DESCRIBING STATES OF CLASSES
3TEPS TOWARDS THE $YNAMIC -ODEL
w
w
w
w
$ERIVE FROM THE
USE CASES
n
3EQUENCE DIAGRAM
n
#OOPERATION DIAGRAM
7HICH DESCRIBE HOW OBJECTS COLLABORATE
$ESCRIBE STATES OF CLASSES IN STATECHART
n
$ERIVE FROM SEQUENCE AND COOPERATION DIAGRAM AS WELL AS USE CASES
!DD OPERATIONS TO CLASS DIAGRAM
29
2001-09-13
3EQUENCE $IAGRAM 3ERVICE 3TATION
#USTOMER
3ERVICE
#REDIT #ARD
3TATION
3YSTEM
0URCHASE
2EFUEL
REFUEL
VERIFY
CUSTOMER
;CANCEL TRANSACTION=
PAY?CASH
;TRANSACTION OK=
NEW0URCHASE
NEW2EFUEL
#OLLABORATION DIAGRAM
w
w
w
w
&ORGET TIMELINE LAYOUT FLEXIBLE
3KETCH OBJECTS
3KETCH OPERATIONS AS ARROWS BETWEEN OBJECTS
.UMBER OPERATIONS
#USTOMER
PARKING!T
PARKING
0ARKING
0URCHASE
3PACE
NEW 0URCHASE
NEXT!VAILABLE
NEW 0ARKING
0ARKING
3ERVICE
3TATION
30
2001-09-13
3TATECHART
w
! FINITE STATE MACHINE CONSISTS OF STATES AND TRANSITIONS
n
w
)N A STATE AN EVENT OCCURS AND INVOKES A TRANSITION TO ANOTHER STATE
3TATECHARTS ARE NESTED FINITE AUTOMATA
n
3TATES CAN BE REFINED TO SUBAUTOMATA
n
0ARALLEL BRANCHES CAN BE EXECUTED IN PARALLEL
%XAMPLE 3TATECHART 3ERVICE 3TATION
/BJECT CREATED
!UTHORIZING
!UTHORIZED
0URCHASED
2EJECTED
/BJECT DIES
31
2001-09-13
!CTIVITY DIAGRAM
w
w
!CTIVITIES WITH FLOW OF DATA BETWEEN THEM
n
$ATA FLOW DIAGRAM
3IMILAR TO 0ETRI NETS
n
0ETRI NETS ARE EVEN BETTER BECAUSE THEY CAN BE ANALYZED SO THAT TOOLS
CAN BE BUILT FOR THEM
w
0ARALLEL BRANCHES ARE PARALLEL
w
'UARD CONDITIONS SPECIFY BRANCHES IN CONTROL FLOW CONDITIONAL DATA
FLOW
%XAMPLE !CTIVITY $IAGRAM 3ERVICE 3TATION
#LASS )NVENTORY
VERIFY3TOCK
;/K=
VERIFY&UEL3TOCK
ORDER&UEL
VERIFY0ARTS3TOCK
;/K=
ORDER0ARTS
32
2001-09-13
5-, IS AN !SPECT/RIENTED ,ANGUAGE
Struture
sequence
Function
statecharts
System
4HE $REAM ! 5-, 7EAVER
5SE #ASE
#OLLABORATION
$IAGRAM
3TRUCTURE
7EAVER
... Aspect-oriented
Programming is
NOT automatic
With UML!
33
2001-09-13
4HE %ND
34
Download