Академический Документы
Профессиональный Документы
Культура Документы
Object-oriented Analysis
(subtopics g and f)
DAAD Project
“Joint Course on Software Engineering”
1
13. Object oriented analysis
a) Overview: approaches, history, literature
b) Object-oriented paradigm: basic notions
c) Sub-models in UML
d) How to read a given static OOA model?
(Class diagram: example „seminar organization“)
e) Detailed specification: DD, pseudo code
f) Packages
g) How to build an OOA model?
h) Analysis patterns of OO
i) Tools
DAAD project „Joint Course on Software Engineering“ © 2
2
Static OOA model: Building and evaluation
Company Person
Booking Lecturer
Shortname: String <10>
Attributes
Attributesand
Number: Serial
and
Name: NameT
Address: AddressT 12
12classes:
classes:
Registered: Date Name: NameT
operations:
Biography: String<400>
Why
Confirmation: Date
operations:
Address: AddressT Daily honorar: Float
Whyexactly
Contact: ContactT
Contact person: NamtT exactly Bill: Date
Checked out: Date
Contact: ContactT
Why
Whyexactly
exactly
Birthday: Date * * *
Sector: String <30> these?
these? Notification: Date
these?
First registered: Date
Contact person birthday: Date
Function: String <30>
these?
Short information: String <200>
Register() Notices: String <200>
Short information: String <200> Check out()
Notices: String <200> Produce notification() Produce address label()
Business volume: Float Prove payment()
Client since: Date
Associate Is able to
Employer 0..1 Contractor 1
Entitlement: RoleET conduct
But: is this
Password: String <6>
Occupation: String <30>
Associate *
model really
Client Biggest problem: useful?
Presentation
* Missing:
Function: String <50>
Business volume: Currency
Where does
1 Participant Number: Short
Duration: Short * • Classes
Seminar supervisor
(especially)
Substitute participant this From: Date • Attributes
Referent
*
Produce Notification() To: Date
0..1
0..1
model 0..1come* * Daily schedular start: Time • Operations?Seminar type
Daily schedular stop: Time
Customer
*
from?
Client booking Company booking
Start first day: Time Short title: String<10>
* * End last day: Time Title: String <50>
1 Place: String <50> * 1 Purpose: String<400>
Address: AddressT Method: String<400>
Public presentation Overview: String<400>
Participant max: Short
Cooperation partner: String<100> Canceled: YesNoET Daily procedure: String<20>
Cancel fee: Float Durance: Short
1
Participant min: Short Cancel() Documents: String<200>
Participant actual: Short Company internal presentation Produce honorar information() Target group: String<200>
3
Class diagram „Seminar organization“:
alternative approach?
Company
Participant
Invoice recipient
Aggregation
Address
Name Notification
Booking
Date
Payment delay
Registration
confirmation
Lecturer
Seminar type
4
Unified software development process (USDP):
Object oriented analysis
5
Usage of UML diagrams during the phases of software development:
Object oriented analysis
Requirements
use case diagrams activity diagrams
class diagrams
Analysis
package diagrams sequence diagrams
Klassendiagramme
class diagrams
(verfeinert,
(refined,
Design
How mit inheritance
to with
derive Vererbung
overall collaboration diagrams
und
andAssoziationen)
associations) state-automata
model of OOA?
component diagrams
Implementation
code classes definitions code methods
6
How to build an OOA model?
7
OOA modelling: Two citations
8
Methodical strategy:
iterative building of OOA model
i=1
Set-up of business
Global analysis
processes, build packages
OOA model 2
OOA model i OOA model 3
i = Iteration number
9
Development of OOA model according to Balzert
Sequences of steps:
• Global analysis: 2 Steps
• Build static model: 7 Steps
• Build dynamic model 3 Steps
Checklists:
• Packages: 5 Steps
• Classes: 8 Steps
• Associations: 11 Steps
• Attributes: 12 Steps
• Inheritance: 4 Steps
• Cardinalities: 4 Steps
• Aggregation and composition: 4 Steps
• Scenarios: 6 Steps
• State automata: 10 Steps
• Operations: 7 Steps
DAAD project „Joint Course on Software Engineering“ © 10
10
Sequence of steps in creation of
OOA-Model: Global Analysis
i=1
Set-up of business
Global analysis
processes, build packages 2 Steps
build build
static dynamic
model model
OOA-Model i
i = Iteration number
11
Global analysis
12
Sequence of steps in creation of
OOA-Model: Static model
i=1
Set-up of business
processes, build packages
build build
7 Steps static dynamic
model model
static model =
Class diagram
OOA model i
i = Iteration number
13
7 steps towards the static model (1)
14
7 steps towards the static model (2)
15
7 steps towards the static model (3)
Attributes:
6 Specification of attributes Syntax and semantics
• For all identified attributes create a detailed
specification
→ Attributes specification
Possibly modification of
7 Identification of patterns class diagram
• Check class diagram for presence of patterns and if
there are, check whether they were correctly modeled.
16
Sequence of steps in creation of
OOA-Model: Dynamic model
i=1
Set-up of business
processes, build packages
build build
static dynamic 3 Steps
model model
Scenarios
OOA model i
State automata
i = Iteration number
Operations
17
3 steps towards the dynamic model (1)
Formalize verbal
description of business
1 Set-up of scenarios processes
• Each business process is specified
by a set of scenarios
- →Sequence diagram, Collaboration diagram
- Alternatively or complementary, activity diagrams or state
automata can be used
2 Set-up of state automata Formalization of
semantics of classes
• For each class examine if a non-trivial life-cycle exists
and needs to be specified
- →State diagram
18
3 steps towards the dynamic model (2)
formalized description of
the semantics of operations
3 Description of operations
• Consider if a description is necessary
- If it is, choose one of the following description forms
according to the level of complexity
• → verbal description of the operations
• → State automata
• → Activity diagram
19
Summary: purpose of dynamic model
Collaboration diagram
Classes
Activity diagram
20
Development of OOA model according to Balzert:
Checklists
Sequences of steps:
• Global analysis: 2 Steps
• Build static model: 7 Steps
• Build dynamic model: 3 Steps
Checklists:
• Packages: 5 Steps
• Classes: 8 Steps When performing the
• Associations: 11 Steps sequences of steps,
checklists are
• Attributes: 12 Steps applied as action
• Inheritance: 4 Steps guidelines.
• Cardinalities: 4 Steps
• Aggregation and composition: 4 Steps
• Scenarios: 6 Steps During lecture we shall
apply some checklists
• State automata: 10 Steps to „Seminar
• Operations: 7 Steps organization“
DAAD project „Joint Course on Software Engineering“ © 21
21
Development of OOA model according to Balzert:
Checklist for classes
Sequences of steps:
• Global analysis: 2 Steps
• Build static model: 7 Steps
• Build dynamic model: 3 Steps
Checklists:
• Packages: 5 Steps
• Classes: 8 Steps
• Associations: 11 Steps
• Attributes: 12 Steps
• Inheritance: 4 Steps
• Cardinalities: 4 Steps
• Aggregation and composition: 4 Steps
• Scenarios: 6 Steps
• State automata: 10 Steps
• Operations: 7 Steps
DAAD project „Joint Course on Software Engineering“ © 22
22
Classes checklist (1)
Result
• Class diagram
- Every class exists in a class diagram – either only with its
name, or with a few important attributes/operations.
- Brief description of classes.
Constructive steps
1. Which classes are identifiable by document analysis
(bottom-up)?
- Attributes are extracted from lists and forms and put
together in classes.
23
Example: Classes identified through document analysis of
‘Application form for presentation’
Registration to ‘Teachware’ seminars
The following person is registered as a participant
Company
Classes identifiable
Street / P.O.Box
Classes identifiable
Country
Zip City
from
fromthis
this form?
Phoneform?
24
Example: Classes identified through document analysis:
three potential classes
25
Classes checklist (2)
26
Example: Classes in technical systems
‚Weather observing station‘
Keyboard Clock LCD display
Wind
Wind direction Work
velocity
sensor station
sensor
Wind Temperature
velocity sensor
Data
sensor
source
Data
source
Data Atmospheric
Wind direction
source humidity sensor
sensor Measurement
Data
Data source
inquiry
27
Classes checklist (3)
28
Example: Classes identified from
requirement specification
4 Product functions Recognize
Recognize
Client:
Client:
class
Actor
Actor
and
one
one
of
of
its
class
which and
data its
are
which data from
are
operations
operations
saved from
this saved
use-case!
4.1 Use cases this use-case!
/F10/ (/PF10/)
Use case: Informing: From question to information
Category: primary
Preconditions: -
Post condition success: Client gets required information.
Post condition failure: The required information can not be issued
Actor: Client manager, client, company
Triggering event: Client writes (letter, fax, e-mail) or calls
Description:
1 Client data retrieval Operations
2 Information issue Operationsofof
class Client
class Client
Extension:
1A client data actualization
2A Production of address label (for sending info material)
Alternatives:
1A An inclusion of a new client Attributes
Attributesof
ofclass
classClient:
Client:
cf.
cf.5.1
5.1Client
Clientdata
data
DAAD project „Joint Course on Software Engineering“ © 29
29
5 Product data
Attributes
Attributesofof
5.1 Client data class
classClient
Client
/D10/ (/LD10/) Client data (max. 50.000)
Client number, name, adress, communication data, date of birth,
function, exchange, short information, notices, info material, client since.
Attributes
Attributesofof
class
classCompany
Company
/D20/ (/LD20/) Company data (max. 10.000), when a client is an associate
of a company:
Company‘s short name, company name, adress, communication data,
contact person, section, date of birth, function of a contact person, short
information, notices, exchange, client since.
/D21/ If a company is in paying delay, then the following data should be
saved:
Date of still unpaid invoice, as well as amount.
Attributes
Attributesofofclass
classPayment
Paymentdelay
delay
30
Client Lecturer Booking Company
Name Number Registred when Short name
Adress Name Validated when Company name
Communication data Address Billed when Address
Date of birth Communication data Cancelled when Communication data
Function Date of birth Notification when Contact person
Exchange Biography Section
Client from Salary per day register() Date of birth
Short information cancel() Function of contact prs.
create Adress-label() Notices create notification() Short information
create Card Lecturer since Notices
Exchange
Client since
cancell()
Min.participant rate
Result:
create Fee-communicatin()
create Participant-list() Classes identified by analysis of
create Certificate()
requirements specification of
‘Seminar organization’
DAAD project „Joint Course on Software Engineering“ © 31
31
/F20/ (/PF20/)
Use case: Booking: from registration to booking. Candidate
Candidateforfor
Category: primary aaclass
class
Preconditions: -
Post condition success: Client is notified.
Post condition failure:
Notification to clients that presentation is overbooked, or does not exist, or
a booking for the client is already made.
Actor: Client manager, client, company
Triggering event: Client registration is available.
Description:
1 Client data retrieval
2 Presentation verification Operations
Operationsofof
3 Booking undertaking class
class
4 Registration notification and sending invoice
5 Sending invoice copy to the accounts department
Extension:
- Attributes:
Attributes:
cfcf5.3
5.3Booking
Bookingdata
Alternatives: data
1A Inclusion of a new client
2A When the presentation is over booked, to point out the alternative one
2B Notification of "false presentation", if the presentation does not exist
32
5.2 Seminar data Attributes:
Attributes:
Presentation,
Presentation,
/D30/ (/LD30/) Presentation data (max. 10.000) Seminar
Seminartype,
type,
Presentation number, duration (in days), from, to, daily period split-
Lecturer
Lecturer
beginning, daily period split-end, beginning of the first day, end of the
last day, presentation place (hotel/company, address, room), public
(yes/no), net price, cancel fee, min. participant rate, max. participant
rate, actual participant, carried out (yes/no)
/D40/ (/LD40/) Seminar type data (max. 10.000)
Short title of seminar, seminar title, purpose, methodic, overview, daily
procedure, duration, records, target group, requirements, fee without
tax, max. participant rate, min. participant rate
/D50/ (/LD50/) Lecturers data (max. 5.000)
Lecturer number, name, address, communication data, date of birth,
biography, daily allowance, short information, notices, lecturer since.
5.3 Booking data
/D60/ If a lecturer conducts a seminar, this information should be saved. .
/D70/ For every seminar booking by company or client, following
information should be saved:
Registered when, validated when, billed when, canceled when,
notification when.
Attributes
Attributesofofclass
classBooking
Booking
33
Classes checklist (4)
34
Client Lecturer Booking Company
Name Number Registred when Short name
Adress Name Validated when Company name
Communication data Address Billed when Address
Date of birth Communication data Cancelled when Communication data
Function Date of birth Notification when Contact person
Persons
Exchange and roles Biography Section
Client from Salary per day register() Date of birth
Short information cancel() Function of contact prs.
create Adress-label() Notices create notification() Short information
create Card Lecturer since Notices Organization
Exchange
Client since
Information about
actions
cancell()
Catalogues
Min.participant rate
create Fee-communicatin()
create Participant-list()
create Certificate()
Participating categories
DAAD project „Joint Course on Software Engineering“ © 35
35
Classes checklist (5)
Analytical steps
6. Is a class name meaningful?
not:
not:Lecturers
Lecturers
- Class name should
• correspond to domain terminology
• be a noun in singular form
• mean the same as the entirety of attributes
• not describe the role of the class with respect to another
class
• be distinct in package resp. in system
• not be synonymous to the name of another class
7. Is chosen abstraction level appropriate?
no
noclasses:
- Goals are not classes:
Address,
Address,Name,Name,
• to create as many classes as possible or ......
• to identify classes of small complexity.
DAAD project „Joint Course on Software Engineering“ © 36
36
Development of OOA model according to Balzert:
Checklist for associations
Sequence of steps:
• Global analysis: 2 Steps
• Static model creation: 7 Steps
• Dynamic model creation: 3 Steps
Checklist:
• Packages: 5 Steps
• Classes: 8 Steps
• Associations: 11 Steps
• Attributes: 12 Steps
• Inheritance: 4 Steps
• Cardinalities: 4 Steps
• Aggregation and composition: 4 Steps
• Scenarios: 6 Steps
• State automata: 10 Steps
• Operations: 7 Steps
DAAD project „Joint Course on Software Engineering“ © 37
37
Checklist associations (2)
2 What associations can be established from description of
business processes?
- Look for the verbs, in particular:
• Spatial closeness (near the)
• Ownership (has)
• Actions (drives)
• Communication (talks to), (married with)
• General relations
3 Is the association part of one of the following categories?
- A is physical component of B
- A is logical component of B
- A is a description of B Illustrated
Illustratedby
bythe
the
- A is a row of a list B example
example
- A is a member (employee) of B.
DAAD project „Joint Course on Software Engineering“ © 38
38
Example of association: Seminar organization
Identified associations, roles, associative classes, categories,
restrictions
is able to conduct
Company booking Seminar type
Category:
Client is an
employee of
a company Company Lecturer
Customer
Employer Conductor Seminar manager
Category:
Category: {subset}
Presentation
Presentationisisaa
Paying delay logical
logicalcomponent
componentofof
Seminar
Seminartype
type
Employee
Participant
Client Presentation
Substitute
participant Booking
39
Checklist associations (3)
- A is organizational unit of B
- A uses B
- A communicates with B
- A owns B
4 Which restrictions needs the association to fulfill?
- One association: {ordered} Illustarted
Illustartedby
bythe
the
example
example
- Several associations: {or}, {subset}
5 Which roles do participating classes play?
- State the name of role, when
• Association exists between objects of the same class
• A class plays different roles in different associations
• The meaning of the class in the association can be
specified more precise through role name.
40
Example of association: Seminar organization
Identified associations, roles, associative classes, categories,
restrictions
is able to conduct
Company booking Seminar type
Company Lecturer
Customer
Employer Conductor Seminar manager
{subset}
Paying delay
Employee
Participant Restriction
Client Presentation
Substitute
participant Booking
41
Checklist associations (5)
42
Example of association: Seminar organization
Identified associations, roles, associative classes, categories,
restrictions
is able to conduct
Company booking Seminar type
Company Lecturer
Customer
Employer Conductor Seminar manager
{subset}
Paying delay
Employee
Participant
Client Presentation
Substitute
participant Booking associative
class
43
Example of association: Seminar organization
Identified associations, roles, associative classes, categories,
restrictions Reading
order
is able to conduct
Company booking Seminar type
Category:
Client is an
employee of Company Lecturer
a company Customer
Employer Conductor Seminar manager
Category:
Category: {subset}
Presentation
Presentationisisaa
Paying delay
logical
logicalcomponent
componentofof
Seminar
Seminartype
type
Employee
Participant Restriction
Client Presentation
Substitute
participant Booking associative
class
44
Example:
Class Payment delay changed to association
before: class
‘Payment delay ‘
Participant
Client Debtor Booking
{ordered by date}
Where
Wherearearethe
the
Restriction attributes of
attributes of
‚Payment
‚Paymentdelay‘?
delay‘?
45
Development of OOA model according to Balzert:
Checklist for attributes
Sequence of steps:
• Global analysis: 2 Steps
• Static model creation: 7 Steps
• Dynamic model creation: 3 Steps
Checklists:
• Packages: 5 Steps
• Classes: 8 Steps
• Associations: 11 Steps
• Attributes: 12 Steps
• Inheritance: 4 Steps
• Cardinalities: 4 Steps
• Aggregation and composition: 4 Steps
• Scenarios: 6 Steps
• State automata: 10 Steps
• Operations: 7 Steps
DAAD project „Joint Course on Software Engineering“ © 46
46
Attributes checklist (1)
Result
• Class diagram
- For each attribute put corresponding name to class
diagram
- Class attributes and derived attributes are marked
• Attributes Specification
- Specify each attribute
- For complex attributes corresponding types are to be
defined (where appropriate).
Attribute types of
different kinds
47
Example attribute types: Seminar organization
Company Person
Shortname: String <10> Booking Lecturer
Number: Serial
Name: NameT Registered: Date Name: NameT Biography: String<400>
Address: AddressT Confirmation: Date Address: AddressT Daily honorar: Float
Contact: ContactT Bill: Date Contact: ContactT
Contact person: NamtT * * *
Sector: String <30>
Checked out: Date
Notification: Date
Birthday: Date
First registered: Date structured
Contact person birthday: Date
Function: String <30> Register()
Short information: String <200>
Notices: String <200>
types (data-
Short information: String <200>
Notices: String <200>
Check out()
Produce notification() Produce address label()
structures)
Business volume: Float Prove payment()
Client since: Date
Associate Is able to
Employer 0..1 Contractor 1
Entitlement: RoleET conduct
elementary Password: String <6>
Occupation: String <30>
Associate * and
Client predefined Presentation
*
Enumeration type
Function: String <50>
Business volume: Currency
1 Participant
types Number: Short
Duration: Short *
Seminar supervisor
48
Development of OOA model according to Balzert:
Checklist for inheritance
Sequence of steps:
• Global analysis: 2 Steps
• Static model creation: 7 Steps
• Dynamic model creation: 3 Steps
Checklists:
• Packages: 5 Steps
• Classes: 8 Steps
• Associations: 11 Steps
• Attributes: 12 Steps
• Inheritance: 4 Steps
• Cardinalities: 4 Steps
• Aggregation and composition: 4 Steps
• Scenarios: 6 Steps
• State automata: 10 Steps
• Operations: 7 Steps
DAAD project „Joint Course on Software Engineering“ © 49
49
Checklist inheritance (2)
Illustrated
Illustrated
Analytical steps by
bythe
the
example
example
3 Is there a „good“ inheritance structure?
- Does inheritance structure improve understanding of
model?
- Are all inherited attributes, operations and associations
required for every subclass?
- Does „is-a“ relationship apply?
- Does inheritance structure correspond to „natural“
structure of problem domain?
- Are there maximally 3 to 5 hierarchy levels?
4 When do we not need inheritance?
- The subclasses denote only different kinds but otherwise
differ neither by their properties nor their behaviour.
50
Inheritance example: Seminar organization (1)
Person
Number: Serial
Name: NameT
Address: AdresseT
compare:
compare:layout
layout
Contact: KontaktT problem
problem infinal
in final
Date of birth: Date
First registred: Date
model
model
Short information: String <200>
All
Allinherited
inherited Notices: String <200>
attributes
attributes produc address label()
required
required
51
Inheritance example: Seminar organization (2)
Booking
Presentation
Registered: Date
Confirmation: Date Number: Short
Bill: Date Duration: Short
Checked out: Date Natural
Naturalstructure
structure
From: Date
To: Date
Notification: Date
of problem
of problem
Daily schedular start: Time
Daily schedular stop: Time
Register()
Check out() domain
domain
Start first day: Time
End last day: Time
Produce notification()
Prove payment() Place: String <50>
Address: AddressT
Participant max: Short
Canceled: YesNoET
Cancel()
Produce honorar information()
52
Development of OOA model according to Balzert:
Checklist for state automata
Sequence of steps:
• Global analysis: 2 Steps
• Static model creation: 7 Steps
• Dynamic model creation: 3 Steps
Checklists:
• Packages: 5 Steps
• Classes: 8 Steps
• Associations: 11 Steps
• Attributes: 12 Steps
• Inheritance: 4 Steps
• Cardinalities: 4 Steps
• Aggregation and composition: 4 Steps
• Scenarios: 6 Steps
• State automata: 10 Steps
• Operations: 7 Steps
DAAD project „Joint Course on Software Engineering“ © 53
53
Checklist for state automata (1)
Description
Descriptionof
of
Result classes
classes
• State diagram
Constructive steps
1 Does a non-trivial life-cycle exist? e.g.
e.g.not
notinin
2 What states does the automat contain? Seminar
Seminartype
type
- Initial state is the starting point
- By which events is a state left?
• Events colloquially described, as „what influences the object
from outside“
- What are the subsequent states?
- How is the state defined (attribute values, object
associations)?
54
Example state automaton:
Seminar organization (Presentation)
updating
/ modify()
client registers
client registers
/ register()
/ register()
client checks out
/ checkOut()
canceled
booking
client when
checks out (full)
/ checkOut()
when
(seminar is
canceled canceled over)
Seminar_presentation
booked
entry/canceling()
when enter()
(presentation is modify()
done)
delete()
register()
performed checkOut()
canceling()
55
Development of OOA model according to Balzert:
Checklist for operations
Sequence of steps:
• Global analysis: 2 Steps
• Static model creation: 7 Steps
• Dynamic model creation: 3 Steps
Checklists:
• Packages: 5 Steps
• Classes: 8 Steps
• Associations: 11 Steps
• Attributes: 12 Steps
• Inheritance: 4 Steps
• Cardinalities: 4 Steps
• Aggregation and composition: 4 Steps
• Scenarios: 6 Steps
• State automata: 10 Steps
• Operations: 7 Steps
DAAD project „Joint Course on Software Engineering“ © 56
56
Checklist operations (1)
Result
• Class diagram with operations inserted
• Description of the operations
Constructive steps
1 Insert operations into class diagram
- Take from scenarios & state automata
- List operations added
- Insert no administrative operations
2 Consider inheritance of operations
- Insert operations into inheritance hierarchy as high as
possible
3 Create descriptions (only where necessary).
57
Example operation: Seminar organization
Company Person
Shortname: String <10> Booking Lecturer
Number: Serial
Name: NameT Registered: Date Name: NameT Biography: String<400>
Address: AddressT Confirmation: Date Address: AddressT Daily honorar: Float
Contact: ContactT Bill: Date Contact: ContactT
Contact person: NamtT * * *
Checked out: Date Birthday: Date
Sector: String <30> Notification: Date First registered: Date
Contact person birthday: Date Short information: String <200>
Function: String <30> Register() Notices: String <200>
Short information: String <200> Check out()
Notices: String <200> Produce notification() Produce address label()
Business volume: Float Prove payment()
Client since: Date
Associate Is able to
Employer 0..1 Contractor 1
Entitlement: RoleET conduct
Password: String <6>
Occupation: String <30>
Associate *
Client Presentation
*
Function: String <50> 1 Participant Number: Short Conductor
Business volume: Currency Duration: Short *
From: Date Sem.
Substitute participant Manager *
Produce Notification() To: Date
0..1 0..1 * *
0..1
Daily schedular start: Time Seminar type
* Client booking Company booking Daily schedular stop: Time
Customer Start first day: Time Short title: String<10>
* * End last day: Time Title: String <50>
1 Place: String <50> * 1 Purpose: String<400>
Address: AddressT Method: String<400>
Public presentation Overview: String<400>
Participant max: Short
Cooperation partner: String<100> Canceled: YesNoET Daily procedure: String<20>
Cancel fee: Float Durance: Short
1
Documents: String<200>
Participant min: Short
Participant actual: Short
new operations Company
from internal presentation Cancel()
Produce honorar information() Target group: String<200>
58
Summary:
Evolution of OOA class models
59
OOA classes: Classes from
document analysis
60
Client Lecturer Booking Company
Name Number Registred when Short name
Adress Name Validated when Company name
Communication data Address Billed when Address
Date of birth Communication data Cancelled when Communication data
Function Date of birth Notification when Contact person
Exchange Biography Section
Client from Salary per day register() Date of birth
Short information cancel() Function of contact prs.
create Adress-label() Notices create notification() Short information
create Card Lecturer since Notices
Exchange
Client since
61
OOA class diagram:
Enhancement with associations
is able to conduct
Company booking Seminar type
Company Lecturer
Customer
Employer Conductor Seminar manager
{subset}
Paying delay
Employee
Participant
Client Presentation
Substitute
participant Booking
62
OOA class diagram:
Enhancement with attribute types
Associate
Company Lecturer << Enumeration>>
Name: NameT Associate
Shortname: String <10> Name: NameT
Entitlement: RoleET
Name: NameT Address: AddressT Seminar manager
Password: String <6>
Address: AddressT Contact: ContactT Client manager
Occupation: String <30>
Contact: ContactT Birthday: Date Presentation manager
Contact person: NamtT Biography: String <400> Administrator
Sector: String <30> Salary per day: Float
Contact person birthday: Date Contractor Short information: String <200>
Function: String <30> Notices: String <200>
Short information: String <200> Lecturer since: Date
is able to conduct
Notices: String <200> Company booking
Business volume: Float
Client since: Date Registered: Date Seminar-
Confirmation: Date
Conductor
Bill: Date manager
Employer Checked out: Date
Notification: Date Presentation
Number: Short
Register()
Duration: Short
Substitute participant Check out()
From: Date
Produce notification()
To: Date
Associate Daily schedular start: Time
Daily schedular stop: Time Seminar type
Client
Start first day: Time
Booking Short title: String<10>
Name: NameT End last day: Time
Address: AddressT Registered: Date Place: String <50> Title: String <50>
Contact: ContactT Confirmation: Date Address: AddressT Purpose: String<400>
Birthday: Date Participant Bill: Date Participant max: Short Method: String<400>
Function: String <50> Checked out: Date Canceled: YesNoET Overview: String<400>
Business volume: Currency Notification: Date Daily procedure: String<20>
First registered: Date Cancel() Durance: Short
Register() Produce honorar information() Documents: String<200>
Customer Target group: String<200>
Produce address label() Check out() Produce participant list()
Produce notification() Produce notification() Produce certificate() Preconditions: String<200>
Charge without tax: Float
Participant number max: Short
Participant number min: short
63
OOA class diagram:
Introduction of inheritance
Booking
Presentation
Registered: Date
Confirmation: Date Number: Short
Bill: Date Duration: Short
Checked out: Date From: Date
Notification: Date To: Date
Daily schedular start: Time
Register() Daily schedular stop: Time
Check out() Start first day: Time
Produce notification() End last day: Time
Prove payment() Place: String <50>
Address: AddressT
Participant max: Short
Canceled: YesNoET
Cancel()
Produce honorar information()
64
OOA class diagram:
Company
Extend with operations
Person
Shortname: String <10> Booking Lecturer
Number: Serial
Name: NameT Registered: Date Name: NameT Biography: String<400>
Address: AddressT Confirmation: Date Address: AddressT Daily honorar: Float
Contact: ContactT Bill: Date Contact: ContactT
Contact person: NamtT Birthday: Date * * *
Checked out: Date
Sector: String <30> Notification: Date First registered: Date
Contact person birthday: Date Short information: String <200>
Function: String <30> Register() Notices: String <200>
Short information: String <200> Check out()
Notices: String <200> Produce notification() Produce address label()
Business volume: Float Prove payment()
Client since: Date
Associate Is able to
Employer 0..1 Contractor 1
Entitlement: RoleET conduct
Password: String <6>
Occupation: String <30>
Associate *
Client Presentation
*
Function: String <50> 1 Participant Number: Short Conductor
Business volume: Currency Duration: Short *
From: Date Sem.
Substitute participant manager *
Produce Notification() To: Date
0..1 0..1 * *
0..1
Daily schedular start: Time Seminar type
* Client booking Company booking Daily schedular stop: Time
Customer Start first day: Time Short title: String<10>
* * End last day: Time Title: String <50>
1 Place: String <50> * 1 Purpose: String<400>
Address: AddressT Method: String<400>
Public presentation Overview: String<400>
Participant max: Short
Cooperation partner: String<100> Canceled: YesNoET Daily procedure: String<20>
Cancel fee: Float Durance: Short
1
Participant min: Short Cancel() Documents: String<200>
Participant actual: Short Company internal presentation Produce honorar information() Target group: String<200>
Register() Preconditions: String<200>
All-inclusive price: Float Charge without tax: Float
Produce participant list() Check out()
Participants max: Short Participant number max: Short
Produce participant certificate() Is free()
Alternative seminars() Participant number min: short
65
Class diagram Seminar organization
Company Person
Shortname: String <10> Booking Lecturer
Number: Serial
Name: NameT Registered: Date Name: NameT Biography: String<400>
Address: AddressT Confirmation: Date Address: AddressT Daily honorar: Float
Contact: ContactT i=1 Bill: Date Contact: ContactT
Contact person: NamtT Birthday: Date * * *
Checked out: Date
Sector: String <30> Notification: Date First registered: Date
Contact person birthday: Date Short information: String <200>
Function: String <30>
Set-up
Short information: business
String <200>
Register()
Check out()
Notices: String <200>
processes,
Notices: String <200>
Business volume: Float
build packages Produce notification() Produce address label()
Prove payment()
Client since: Date
first iteration
Password: String <6>
Occupation: String <30>
Associate *
build build Presentation
Client
static 1
dynamic
Participant Number: Short
*
Seminar supervisor
Function: String <50>
Business volume: model
Currency
Produce Notification()
model
Substitute participant
0..1
Duration: Short
From: Date
To: Date
☺ *
Referent
*
0..1 * *
0..1
Daily schedular start: Time Seminar type
* Client booking Company booking Daily schedular stop: Time
Customer Start first day: Time Short title: String<10>
* * End last day: Time Title: String <50>
1 Place: String <50> * 1 Purpose: String<400>
Address: AddressT Method: String<400>
Public presentation Overview: String<400>
OOA Model i
Cooperation partner: String<100>
Participant max: Short
Canceled: YesNoET Daily procedure: String<20>
Cancel fee: Float Durance: Short
1
Participant min: Short Cancel() Documents: String<200>
Participant actual: Short i = Iteration
Companynumber
internal presentation Produce honorar information() Target group: String<200>
Register() Preconditions: String<200>
All-inclusive price: Float Charge without tax: Float
Produce participant list() Check out()
Participants max: Short Participant number max: Short
Produce participant certificate() Is free()
Alternative seminars() Participant number min: short
66
13. Object oriented analysis
a) Overview: approaches, history, literature
b) Object-oriented paradigm: basic notions
c) Sub-models in UML
d) How to read a given static OOA model?
(Class diagram: example „seminar organization“)
e) Detailed specification: DD, pseudo code
f) Packages
g) How to build an OOA model?
h) Analysis patterns of OO
i) Tools
DAAD project „Joint Course on Software Engineering“ © 67
67
Aims of OOA patterns
Why
WhyOOA
OOApattern?
pattern?
68
Seminar organization: identification of patterns
Company Person
Shortname: String <10> Booking Lecturer
Number: Serial
Name: NameT Registered: Date Name: NameT Biography: String<400>
Address: AddressT Confirmation: Date Address: AddressT Daily honorar: Float
Contact: ContactT Bill: Date Contact: ContactT
Contact person: NamtT * * *
Sector: String <30> Pattern 9:
Checked out: Date
Notification: Date
Birthday: Date
Pattern 6:
First registered: Date
Contact person birthday: Date
Function: String <30> Group
Register() Roles
Short information: String <200>
Notices: String <200>
Short information: String <200> Check out()
Notices: String <200> Produce notification() Produce address label()
Business volume: Float Prove payment()
Client since: Date
Associate Is able to
Employer 0..1 Contractor 1
Entitlement: RoleET conduct
Pattern 5: Password: String <6>
Occupation: String <30>
Associate * Coordinator
Client Presentation
*
Function: String <50> 1 Participant Number: Short Conductor
Business volume: Currency Duration: Short *
From: Date Sem.
Substitute participant manager *
Produce Notification() To: Date
0..1 0..1 * *
0..1
Daily schedular start: Time Seminar type
Customer
* Client booking Pattern
Company 2:
booking Daily schedular stop: Time
Start first day: Time Short title: String<10>
Title: String <50>
*
1
Instance
*
type End last day: Time
Place: String <50> * 1 Purpose: String<400>
Address: AddressT Method: String<400>
Public presentation Overview: String<400>
Participant max: Short
Cooperation partner: String<100> Canceled: YesNoET Daily procedure: String<20>
Cancel fee: Float Durance: Short
1
Participant min: Short Cancel() Documents: String<200>
Participant actual: Short Company internal presentation Produce honorar information() Target group: String<200>
Register() Preconditions: String<200>
All-inclusive price: Float Charge without tax: Float
Produce participant list() Check out()
Participants max: Short Participant number max: Short
Produce participant certificate() Is free()
Alternative seminars() Participant number min: short
69
OOA pattern 1: List (Example) Not
in
case study
Number 4 Number
Malfunction status ok Malfunction status
Note
1
X Y Occupation Waiting
coordinate coordinate status sign Shelf 1.*
50 100 Free No A
50 200 Occupied No A Stock place
50 300 Free No A
X coordinate
Y coordinate
Occupation status
Waiting sign
Shelf
70
Pattern 1: List not
in case
study
There is a composition
Consists only of same parts, therefore there is
only one part-class
Part-objects are strongly connected to aggregate
object
• However they can be deleted before the whole
aggregation is deleted
The attribute values of the aggregate object hold
also for part-objects
The aggregate object contains at least one part-
object, i.e. the cardinality of it is generally 1..*.
DAAD project „Joint Course on Software Engineering“ © 71
71
Seminar type
OOA Pattern 2:
Title Instance type
Purpose (case study)
Method
Overview
Type (kind) of
Instances
1 (description)
Presentation
Instance
Number
Duration
From
To
72
Pattern 2: Instance type
Simple association
Once created object connections will generally not
be changed
• They will only be deleted when corresponding instance
is removed
The name of the type class often consists of the
notion of type, group, description, specification
A type class (description) may – from time to time
– exist independently of concrete instances
• Therefore, the cardinality is generally many (0..m)
Removing type class (description) leads to
redundant „storing“ of attribute-values
73
Seminar organization: identification of patterns
Company Person
Shortname: String <10> Booking Lecturer
Number: Serial
Name: NameT Registered: Date Name: NameT Biography: String<400>
Address: AddressT Confirmation: Date Address: AddressT Daily honorar: Float
Contact: ContactT Bill: Date Contact: ContactT
Contact person: NamtT Birthday: Date * * *
Checked out: Date
Sector: String <30> Notification: Date First registered: Date
Contact person birthday: Date Short information: String <200>
Function: String <30> Register() Notices: String <200>
Short information: String <200> Check out()
Notices: String <200> Produce notification() Produce address label()
Business volume: Float Prove payment()
Client since: Date
Associate Is able to
Employer 0..1 Contractor 1
Entitlement: RoleET conduct
Password: String <6>
Occupation: String <30>
Associate *
Client Presentation
*
Function: String <50> 1 Participant Number: Short Conductor
Business volume: Currency Duration: Short *
From: Date Sem.
Substitute participant manager *
Produce Notification() To: Date
0..1 0..1 * *
0..1
Daily schedular start: Time Seminar type
* Client booking Company booking Daily schedular stop: Time
Customer Pattern 2: Start first day: Time Short title: String<10>
Title: String <50>
* * End last day: Time
1 Instance type Place: String <50> * 1 Purpose: String<400>
Address: AddressT Method: String<400>
Public presentation Overview: String<400>
Participant max: Short
Cooperation partner: String<100> Canceled: YesNoET Daily procedure: String<20>
Cancel fee: Float Durance: Short
1
Participant min: Short Cancel() Documents: String<200>
Participant actual: Short Company internal presentation Produce honorar information() Target group: String<200>
Register() Preconditions: String<200>
All-inclusive price: Float Charge without tax: Float
Produce participant list() Check out()
Participants max: Short Participant number max: Short
Produce participant certificate() Is free()
Alternative seminars() Participant number min: short
74
OOA pattern 3: Assembly (Example) not
in case
study
Physical objects are considered
There is a composition Car
75
OOA pattern 4: Parts list (Example) not
in case
study
:Graphic :Component
0..1 Title
0..1
Contents
Line Rectangle Text Graphic
76
Pattern 4: Parts list not
in case
study
There is a composition
The aggregate-object and its part-objects need
the ability to be dealt with as a union as well as
individual objects.
Part-objects can become connected with other
aggregate objects.
The cardinality of aggregate class is 0..1
An object of type A can be composed of more
objects of types A, B and C
A special case of parts list is, that the list does not
consist of objects of different kinds, but only of
objects of the same kind.
DAAD project „Joint Course on Software Engineering“ © 77
77
OOA pattern 5: Coordinator
1 1
1 1
Customer Product Customer Selling Product
Date
Discount
Selling
Date
Discount
Coordinator
Association Class
replaced by
an associative
class
78
Pattern 5: Coordinator
79
Seminar organization: identification of patterns
Company Person
Shortname: String <10> Booking Lecturer
Number: Serial
Name: NameT Registered: Date Name: NameT Biography: String<400>
Address: AddressT Confirmation: Date Address: AddressT Daily honorar: Float
Contact: ContactT Bill: Date Contact: ContactT
Contact person: NamtT Birthday: Date * * *
Checked out: Date
Sector: String <30> Notification: Date First registered: Date
Contact person birthday: Date Short information: String <200>
Function: String <30> Register() Notices: String <200>
Short information: String <200> Check out()
Notices: String <200> Produce notification() Produce address label()
Business volume: Float Prove payment()
Client since: Date
Associate Is able to
Employer 0..1 Contractor 1
Entitlement: RoleET conduct
Pattern 5: Password: String <6>
Occupation: String <30>
Associate * Coordinator
Client Presentation
*
Function: String <50> 1 Participant Number: Short Conductor
Business volume: Currency Duration: Short *
From: Date Sem,
Substitute participant manager *
Produce Notification() To: Date
0..1 0..1 * *
0..1
Daily schedular start: Time Seminar type
* Client booking Company booking Daily schedular stop: Time
Customer Start first day: Time Short title: String<10>
* * End last day: Time Title: String <50>
1 Place: String <50> * 1 Purpose: String<400>
Address: AddressT Method: String<400>
Public presentation Overview: String<400>
Participant max: Short
Cooperation partner: String<100> Canceled: YesNoET Daily procedure: String<20>
Cancel fee: Float Durance: Short
1
Participant min: Short Cancel() Documents: String<200>
Participant actual: Short Company internal presentation Produce honorar information() Target group: String<200>
Register() Preconditions: String<200>
All-inclusive price: Float Charge without tax: Float
Produce participant list() Check out()
Participants max: Short Participant number max: Short
Produce participant certificate() Is free()
Alternative seminars() Participant number min: short
80
OOA-Pattern 6: Roles (Example)
:Presentation
Refe Roles
rent Seminar
Number = 4632
Sem :Lecturer * manager
i
m an nar Presentation Lecturer
age
r Name = Smith {subset}
:Presentation
t Number Number
r ticipan Duration * Name
Number = 4712
Pa From Conductor* Address
To
Participant
{Participant ≠ Referent}
several associations
between two classes
81
Pattern 6: Roles
82
Seminar organization: identification of patterns
Company Person
Shortname: String <10> Booking Lecturer
Number: Serial
Name: NameT Registered: Date Name: NameT Biography: String<400>
Address: AddressT Confirmation: Date Address: AddressT Daily honorar: Float
Contact: ContactT Bill: Date Contact: ContactT
Contact person: NamtT Birthday: Date * * *
Checked out: Date
Sector: String <30> Notification: Date Pattern 6:
First registered: Date
Contact person birthday: Date
Function: String <30> Register() Roles
Short information: String <200>
Notices: String <200>
Short information: String <200> Check out()
Notices: String <200> Produce notification() Produce address label()
Business volume: Float Prove payment()
Client since: Date
Associate Is able to
Employer 0..1 Contractor 1
Entitlement: RoleET conduct
Password: String <6>
Occupation: String <30>
Associate *
Client Presentation
*
Function: String <50> 1 Participant Number: Short Conductor
Business volume: Currency Duration: Short *
From: Date Sem.
Substitute participant manager *
Produce Notification() To: Date
0..1 0..1 * *
0..1
Daily schedular start: Time Seminar type
* Client booking Company booking Daily schedular stop: Time
Customer Start first day: Time Short title: String<10>
* * End last day: Time Title: String <50>
1 Place: String <50> * 1 Purpose: String<400>
Address: AddressT Method: String<400>
Public presentation Overview: String<400>
Participant max: Short
Cooperation partner: String<100> Canceled: YesNoET Daily procedure: String<20>
Cancel fee: Float Durance: Short
1
Participant min: Short Cancel() Documents: String<200>
Participant actual: Short Company internal presentation Produce honorar information() Target group: String<200>
Register() Preconditions: String<200>
All-inclusive price: Float Charge without tax: Float
Produce participant list() Check out()
Participants max: Short Participant number max: Short
Produce participant certificate() Is free()
Alternative seminars() Participant number min: short
83
:Customer
Not
in
case study
:Prospective
:Addressee
Period =
customer
Period =
:Participant
OOA pattern 7:
(1.1.00,
30.6.00)
(1.7.00,
7.10.00)
Period =
(8.10.00) Alternating Roles
(Example)
Alternating Customer
roles
Name
Address
1
CustomerRole
Abstract
Period role
Priority category
Concrete
role
84
Pattern 7: Alternating roles Not
in
case study
85
:Book copy
Not
Inventory Nr.= 1222 in
Period = (12.1.00, case study
31.1.00)
OOA-Pattern 8:
History
:Book copy
:Book copy
86
Pattern 8: History Not
in
case study
87
OOA pattern 9: Group (Example)
several
severalsingle
singleobjects
objects
belong to the same
belong to the same
group
groupobject
object
88
OOA pattern 9: Group
89
Seminar organization: identification of patterns
Company Person
Shortname: String <10> Booking Lecturer
Number: Serial
Name: NameT Registered: Date Name: NameT Biography: String<400>
Address: AddressT Confirmation: Date Address: AddressT Daily honorar: Float
Contact: ContactT Bill: Date Contact: ContactT
Contact person: NamtT * * *
Sector: String <30> Pattern 9:
Checked out: Date
Notification: Date
Birthday: Date
First registered: Date
Contact person birthday: Date
Function: String <30> Group
Register()
Short information: String <200>
Notices: String <200>
Short information: String <200> Check out()
Notices: String <200> Produce notification() Produce address label()
Business volume: Float Prove payment()
Client since: Date
Associate Is able to
Employer 0..1 Contractor 1
Entitlement: RoleET conduct
Password: String <6>
Occupation: String <30>
Associate *
Client Presentation
*
Function: String <50> 1 Participant Number: Short Conductor
Business volume: Currency Duration: Short *
From: Date Sem.
Substitute participant manager *
Produce Notification() To: Date
0..1 0..1 * *
0..1
Daily schedular start: Time Seminar type
* Client booking Company booking Daily schedular stop: Time
Customer Start first day: Time Short title: String<10>
* * End last day: Time Title: String <50>
1 Place: String <50> * 1 Purpose: String<400>
Address: AddressT Method: String<400>
Public presentation Overview: String<400>
Participant max: Short
Cooperation partner: String<100> Canceled: YesNoET Daily procedure: String<20>
Cancel fee: Float Durance: Short
1
Participant min: Short Cancel() Documents: String<200>
Participant actual: Short Company internal presentation Produce honorar information() Target group: String<200>
Register() Preconditions: String<200>
All-inclusive price: Float Charge without tax: Float
Produce participant list() Check out()
Participants max: Short Participant number max: Short
Produce participant certificate() Is free()
Alternative seminars() Participant number min: short
90
Not
OOA pattern 10: Group history (Example) in
case study
Membership
Period
Ending reason
91
Pattern 10: Group history Not
in
case study
92