Giáo trình Kỹ nghệ phần mềm - Bài 5: Các mô hình hệ thống

Slide bài giảng

• Từ bài này slide bài giảng để nguyên tiếng Anh

– Sinh viên hỏi trên lớp nếu có phần nào chưa hiểu

– Có thể dùng diễn đàn môn học để trao đổi

pdf45 trang | Chuyên mục: Công Nghệ Phần Mềm | Chia sẻ: dkS00TYs | Lượt xem: 2157 | Lượt tải: 1download
Tóm tắt nội dung Giáo trình Kỹ nghệ phần mềm - Bài 5: Các mô hình hệ thống, để xem tài liệu hoàn chỉnh bạn click vào nút "TẢI VỀ" ở trên
m
Validate 
order
Record 
order
Send to 
supplier
Order details + 
blank order form
Signed form
Checked 
and signed 
order + 
order 
notification
Adjust available 
budget
Filled form Signed form
Order 
file
Budget 
file
Signed form
Order details Order amount + 
account details
Data flow diagrams
• Model the system from a functional
perspective.
• Tracking and documenting how the data 
associated with a process 
– Helpful to develop an overall understanding of the 
system.
• May be used to show the data exchange 
between a system and other systems
Example: Insulin pump DFD
Blood sugar 
sensor
Blood sugar 
analysis
Insulin 
requirement 
Blood
Blood 
parameters
Blood sugar level
computation
Insulin 
delivary
controller
Insulin 
requirement
Insulin
Pup control 
commandsInsulin 
pump
State machine models/Statecharts
• Model the behaviour of the system in 
response to external and internal events.
• Show the system’s responses to stimuli so are 
often used for modelling real-time systems.
• Show system states as nodes and events as 
arcs between these nodes. 
–When an event occurs, the system moves from 
one state to another.
Statecharts
• Allow the decomposition of a model into sub-
models (see following slide)
• A brief description of the actions is included 
following the ‘do’ in each state
• Can be complemented by tables describing 
the states and the stimuli
• Are an integral part of the UML
Microwave oven statechart
Full power
do: operate
Full
power
Full
power
Number
do: set power
= 600
Set time
do: get number
Operation
Waiting
do: display
time
Timer
Enabled
oven
Half
power
Half
power
Door
open
Door
closed
Door
closed
Door
open
Start
Half power
do: set power
= 300
exit: set time
Disabled
Cancel
Waiting
do: display
time
do: display
'Ready'
do: display
'Waiting'
Timer
Microwave oven state description
State Description
Waiting The oven is waiting for input. The display shows the current time.
Half power The oven power is set to 300 watts. The display shows ‘Half power’.
Full power The oven power is set to 600 watts. The display shows ‘Full power’.
Set time The cooking time is set to the user’s input value. The display shows the
cooking time selected and is updated as the time is set.
Disabled Oven operation is disabled for safety. Interior oven light is on. Display
shows ‘Not ready’.
Enabled Oven operation is enabled. Interior oven light is off. Display shows
‘Ready to cook’.
Operation Oven in operation. Interior oven light is on. Display shows the timer
countdown. On completion of cooking, the buzzer is sounded for 5
seconds. Oven light is on. Display shows ‘Cooking complete’ while
buzzer is sounding.
Microwave oven stimuli
Stimulus Description
Half power The user has pressed the half power button
Full power The user has pressed the full power button
Timer The user has pressed one of the timer buttons
Number The user has pressed a numeric key
Door open The oven door switch is not closed
Door closed The oven door switch is closed
Start The user has pressed the start button
Cancel The user has pressed the cancel button
Data models
• Used to describe the logical structure of data 
processed by the system.
• An entity-relation-attribute model sets out the 
entities in the system, the relationships between 
these entities and the entity attributes
• Widely used in database design. Can readily be 
implemented using relational databases.
• No specific notation provided in the UML but objects 
and associations can be used.
LIBSYS data model
Data dictionaries
• Data dictionaries are lists of all of the names used
– Also include descriptions of the entities, relationships and 
attributes
• Advantages
– Support name management and avoid duplication;
– Store of organisational knowledge linking analysis, design 
and implementation
• Many CASE workbenches support data dictionaries.
Data dictionary example
Name Description Type Date
Article Details of the published article that may be
ordered by people using LIBSYS.
Entity 30.12.2002
authors The names of the authors of the article
who may be due a share of the fee.
Attribute 30.12.2002
Buyer The person or organisation that orders a
copy of the article.
Entity 30.12.2002
fee-
payable-to
A 1:1 relationship between Article and the
Copyright Agency who should be paid the
copyright fee.
Relation 29.12.2002
Address
(Buyer)
The address of the buyer. This is used to
any paper billing information that is
required.
Attribute 31.12.2002
Object models
• Describe the system in terms of classes and their 
associations
• A class is an abstraction over a set of objects with 
common attributes and the services (operations)
• Various object models may be produced
– Inheritance models;
– Aggregation models;
– Interaction models.
• UML is an effective standard for object-oriented 
modelling
Object models
• Natural ways of reflecting the real-world 
entities manipulated by the system
• More abstract entities are more difficult to 
model using this approach
• Class identification is a difficult process
– Requiring a deep understanding of the application 
domain
• Classes reflecting domain entities are reusable 
across systems
UML classes notations
• Some notations
– Object classes are rectangles with the name at the 
top, attributes in the middle section and 
operations in the bottom section;
– Relationships between object classes (known as 
associations) are shown as lines linking objects;
– Inheritance is referred to as generalisation
Inheritance models
• Organise the domain classes into a hierarchy
• Classes at the top of the hierarchy reflect the 
common features of all classes
• Classes inherit their attributes and services from 
super-classes
– These services may then be specialised as necessary
• Class hierarchy design can be a difficult process if 
duplication in different branches is to be avoided
Library class hierarchy
User class hierarchy
Name
Address
Phone
Registration #
Library user
Register ()
De-register ()
Affilia tion
Reader
Items on loan
Max. loans
Borrower
Department
Department phone
Staff
Major subject
Home address
Student
Multiple inheritance
• Allows object classes to inherit from several super-
classes
– Rather than inheriting the attributes and services from a 
single parent class
• Can lead to semantic conflicts 
– When attributes/services with the same name in different 
super-classes have different semantics
• Multiple inheritance makes class hierarchy 
reorganisation more complex
Multiple inheritance
Object aggregation
• An aggregation model shows how classes that 
are collections are composed of other classes.
• Aggregation models are similar to the part-of 
relationship in data models.
Object aggregation example
Interaction models
• A behavioural model shows the interactions 
between objects to produce some particular 
system behaviour that is specified as a use-
case.
• In UML: Use sequence diagrams or 
collaboration diagrams to model interaction 
between objects
Issue of electronic items
Structured methods
• Incorporate system modelling as an inherent 
part of the method
– For requirement elicitation and analysis
• Define a set of models, a process for deriving 
these models, and rules and guidelines that 
should apply to the models
• Supported by some CASE tools
Structured method’s weaknesses
• Do not model non-functional system 
requirements
• Do not usually include information about 
whether a method is appropriate for a given 
problem
• May produce too much documentation
• The system models are too detailed and 
difficult for users to understand.
CASE workbenches
• A coherent set of tools that is designed to support 
related software process activities such as analysis, 
design or testing.
• Analysis and design workbenches support system 
modelling during both requirements engineering and 
system design.
• These workbenches may support a specific design 
method or may provide support for a creating several 
different types of system model.
An analysis and design workbench
Report 
generation 
facilities Query 
language 
facilities
Structured 
diagraming
tools
Central 
Information 
Repository
Inport/Export 
facilities
Design, 
analysis and 
checking tools
Forms 
creation tools
Code 
generator
Data 
dictionary
Analysis workbench components
• Diagram editors
• Model analysis and checking tools
• Repository and associated query language
• Data dictionary
• Report definition and generation tools
• Forms definition tools
• Import/export translators
• Code generation tools
Key points
• A model is an abstract system view. Complementary 
types of model provide different system information.
• Context models show the position of a system in its 
environment with other systems and processes.
• Data flow models may be used to model the data 
processing in a system.
• State machine models model the system’s behaviour 
in response to internal or external events
Key points
• Semantic data models describe the logical structure 
of data which is imported to or exported by the 
systems.
• Object models describe logical system entities, their 
classification and aggregation.
• Sequence models show the interactions between 
actors and the system objects that they use.
• Structured methods provide a framework for 
developing system models.
Bài tập về nhà, bài tập nhóm
• Bài tập về nhà
– Trả lời 8.3, 8.6 và 8.8, sách SE của I. Summerville, trang 191
– Sử dụng công cụ tạo 5 mô hình (model) mô tả một số phần
của hệ thống trang web môn học: 
– Học sử dụng Enterprise Architecture của sparxsystems
• Bài tập nhóm
– Tạo các mô hình cho bài tập lớn
– Nộp hiện trạng/tiến độ lên trang web môn học
• Các công việc đã làm được
• Hạn: 18/10/2009

File đính kèm:

  • pdfGiáo trình Kỹ nghệ phần mềm - Bài 5 Các mô hình hệ thống.pdf
Tài liệu liên quan