Professional Documents
Culture Documents
System Design:
Component Design: Model
D r. R u d r a P r a t a p D e b N a t h
Associate Professor
Department of Computer Science and Engineering
University of Chittagong
Email:rudra@cu.ac.bd
COMPONENT
DESIGN
2
COMPONENT DESIGN
<<component>> <<component>>
Model Function
Customer Account type Interest admin
• Component details customer-no.
name
disignation
1..* 1
address
• Connections between correct data change interest
open account control calc of
components close account
rate
interest
1..* 1 1
components 1
1..*
• Influences the process Transaction Value set:
{open, closed}
architecture transtype
date
amount Value set:
{deposit, withdraw,
30/10/14 interest}
3
SU:L10.E14
OVERVIEW OF ‘COMPONENTS’
• To determine an implementation of
Purpose requirements within an architectural
framework.
4
FROM ARCHITECTURE
TO COMPONENTS
<<component>>
user interface
<<component>>
function
<<component>>
model
Principles:
● Respect the component
architecture
● Adapt component designs to the
30/10/14
technical possibilities
5
SU:L10.E14
ACTIVITIES IN ’COMPONENT
DESIGN’
• How is the model represented as
classes in the system?
Model
component • Model component and attribute
Analyse af
Analyse af
problem-
anvendelses-
område
område
Design af
Model komponenter
6
2
MODEL
COMPONENT
7
OVERVIEW OF ‘MODEL
COMPONENT’
8
RESULT OF MODEL
COMPONENT
Customer
creditapproval
creditapprovaldate
name • Starting point: the
class diagram from
1 1
1..* 1..* the problem domain
Customer address Account
accountnumber
analysis
fromdate accountstate
• Extended to handle
adress opendate
closedate
behavior
1
0..* • Adding new classes
Transaction
• Adding attributes
creditapproval
creditapprovaldate • Adding and revising structures
name
9
ACTIVITIES IN
‘MODEL COMPONENT’
10
FROM OVERVIEW TO
SPECIFICATIONS OF DETAILS
<<component>>
• Component: user interface
A collection of program
<<component>>
parts that constitutes a function
whole and has well-
defined responsibilities. <<component>>
model
• Responsibility of the
model component:
maintain an updated
representation of the
problem domain.
11
30/10/14
SU:L10.E14
ANALYSIS MODEL FOR
BANK SYSTEM
credit approval
(date, name, address)
Approved
Customer
account opened
• Class diagram name
change address
(date, address)
(date)
account closed
(date)
Active
• Event table
1
account account deposit withdraw
opened closed (date, (date,
(date) (date) amount) amount)
Event Customer Account
1..*
Credit approval +
Account
Change adress * accountnumber
account opened
Account opened * + (date)
Withdraw * *
deposit withdraw
(date, (date,
amount) amount)
12
REPRESENT PRIVATE events
that
involve
only
one
problem-‐domain
object.
EVENTS
• Sequence and selection
• Represent these events as an attribute in the class described in the
state chart diagram.
• The system assigns a value to the attribute when the event occurs.
• Integrate the attributes of the event in the class.
• Iteration
• Represent these events as a new class, connect it to the class
described in the state chart diagram with an aggregation structure.
• The system generates a new object of the class each time the event
occurs
• Integrate the attributes of the event in the class.
13
REPRESENT PRIVATE Eventç Customer Account
EVENTS
Credit approval +
Change adress *
Account opened * +
Account closed * +
• The event ‘credit approval’ is private Deposit * *
to the class customer and is a Withdraw * *
sequence in the state chart diagram
for the class Customer
• Represented as an attribute creditapproval
creditapprovaldate
14
REPRESENT COMMON
EVENTS
events
that
involve
two
or
more
problem-‐domain
objects.
• Common events
• Represent the event in relation to one of the objects
• Consider adding structural connections to give the other
objects access to the relevant attributes.
• Represent common events in the way that offers the
simplest structure.
15
REPRESENT COMMON EVENTS:
Eventç Customer Account
Credit approval +
CHOOSING A SIMPLE Change adress *
Customeraddres Account
fromdate accountnumber
address accountstate
opendate
closedate
16
REPRESENTATION OF
Event Customer Account
Credit approval +
COMMON EVENTS: Change adress *
1 1
0..* 0..*
Deposit Withdraw
17
REPRESENTATION OF
COMMON EVENTS:
SOLUTION B
• Alternatively: the events • Gives a complex
can be represented as structure (two
new classes under the associations across)
customer class • We would therefore
choose solution A
Customer
1 1 1 1
1..* 1..* 0..* 0..*
Customer 1
Account Deposit Withdraw
address 0..*
1 0..*
18
RESTRUCTURE
CLASSES (1)
Account Account
• The revised class accountnumber
accountstate
accountnumber
accountstate
diagram represents the opendate
closedate
opendate
closedate
information form the
state chart diagrams.
• The class diagram can 1 1 1
0..*
0..* 0..*
often be restructured Withdraw Transaction
Deposit
and simplified without date date transtype
any loss of information: amount amount date
amount
• Generalization
• Association
• Embedded iterations
19
RESTRUCTURE
CLASSES (2)
0..*
Gas station Customer
0..*
0..* 0..*
Gas station Customer
Filling
1 1
0..* 0..*
Filling
20
30/10/14
SU:L10.E14
RESTRUCTURE
CLASSES (3)
Person
status
Person date of birth
date of death
1
0..*
1 1 1
0..* 0..* 0..* Hospitalization
status
Hospitalization Treatment Discharge entrydate
exitdate
1
0..*
21
30/10/14
SU:L10.E14
GROUP ASSIGNMENT
Complete the activity “Model component” for the cinema example:
22
ASSIGNMENT
Represent private events
• Selection/sequence: attribute
• Iteration: class
Movie Movie Represent common events
Movie played rated • Choose between alternatives
(date, time) (rate, date)
Movie Movie
opened closed
(date) Play
(date)
Active planned
Cinema (date, time)
Play Cinema Cinema
planned opened closed
(date, time) (date) (date)
Active
Movie
viewed
Play (date)
Movie Movie Customer Play Cinema
Play planned played Movie opened +
(date, time) (date, time) Movie closed +
Planned
Movie played * +
Play planned * + *
Customer closed +
Movie Movie
viewed rated Customer opened +
Customer (rate, date)
(date) Movie viewed * *
Customer Customer Movie rated * *
opened closed
Cinema opened +
23
(date) (date)
Active Cinema closed +
OVERVIEW OF ‘MODEL
COMPONENT’
24