Tài liệu này dành cho sinh viên, giáo viên khối ngành công nghệ thông tin tham khảo và có những bài học bổ ích hơn, bổ trợ cho việc tìm kiếm tài liệu, giáo án, giáo trình, bài giảng các môn học khối ngành công nghệ thông tin
Trang 1System models
(Bài 5: Các Mô hình Hệ thống)
Trang 2Slide 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
Trang 3• To explain why the context of a system should
be modelled as part of the RE process
• To describe behavioural modelling, data
modelling and object modelling
• To introduce some of the notations used in
the Unified Modeling Language (UML)
• To show how CASE workbenches support
system modelling
Trang 6• Represent all external entities that may interact with a system.
• Represent all external entities that may interact with a system – Behavioural perspective showing the behaviour of the system;
• Internal working of system’s elements – Structural perspective showing the system or data
architecture
• Elements and their relationships
Trang 7Model types
• Data processing model showing how the data is
processed at different stages.
• Composition model showing how entities are
composed of other entities.
• Architectural model showing principal sub-systems.
• Classification model showing how entities have
common characteristics.
• Stimulus/response model showing the system’s
reaction to events.
Trang 8Context models
• Context models are used to illustrate the
operational context of a system –
– Show what lies outside the system boundaries
• Social and organisational concerns may affect
• Social and organisational concerns may affect the decision on where to position system
boundaries
• Architectural models show the system and its
relationship with other systems
Trang 9The context of an ATM system
ATM system
Account DB Branch
system
Branch Accounting system
Branch
Security system
– Does not show physical locations, how they are connected, how data is moving around
Usage DB system
Branch counter system
Mantainance system
Trang 10Process models
• Process (tiến trình) models show the overall process and the processes that are supported
by the system
• Data flow (luồng dữ liệu) models may be used
• Data flow (luồng dữ liệu) models may be used
to show the processes and the flow of
information from one process to another
Trang 11Equipment procurement process
Get cost estimates
Accept delivery of equipment
Check delivered items
Validate specification
Specify
equipment
required
Equipment spec.
Checked spec.
Delivery note
Delivery note
Order notifica tion
Installation instructions
Spec + supplier + estimate Supplier list
Equipment spec.
Choose supplier
Place equipment order
Install equipment
Find suppliers
Supplier database
Accept delivered equipment
Equipment database
Installation acceptance
Equipment details
Checked and signed order form
Order details plus blank or der for m Supplier list
spec.
Trang 12Behavioural models
• Used to describe the overall behaviour of a system
• Two types of behavioural model:
– Data processing models that show how data is
– Data processing models that show how data is processed as it moves through the system;
– State machine models that show the systems response to events.
• Both of them are required to describe the system’s behaviour
Trang 14Example: Order processing DFD
Complete
order form
Validate order
Record order
Send to supplier
Order details +
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
Trang 15Data 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
Trang 16Example: Insulin pump DFD
Blood sugar sensor
Blood sugar analysis
Insulin requirement
Blood
Blood parameters
Blood sugar level
requirement computation
Insulin delivary controller
Insulin requirement Insulin
Pup control commands Insulin
pump
Trang 17State 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
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.
Trang 18following the ‘do’ in each state
• Can be complemented by tables describing the states and the stimuli
• Are an integral part of the UML
Trang 19Microwave oven statechart
Number
do: set power
= 600
Set time do: get number
Half
power
Half power power
Door open
Door closed
Door closed
Door open
Start
Half power do: set power
time
do: display 'Ready'
do: display 'Waiting' Timer
Trang 20Microwave oven 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 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.
Trang 21Microwave oven stimuli
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 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
Trang 22Data 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.
Trang 23LIBSYS data model
Trang 24Data 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.
Trang 25Data 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 who may be due a share of the fee.
Buyer The person or organisation that orders a
copy of the article.
Attribute 31.12.2002
Trang 27Object 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
Trang 28UML 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
Trang 29Inheritance 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
• 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
Trang 30Library class hierarchy
Trang 31User 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 ad dress Student
Trang 32• Can lead to semantic conflicts
• 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
Trang 33Multiple inheritance
Trang 35Object aggregation example
Trang 36Interaction 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
Trang 37Issue of electronic items
Trang 38Structured 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
• 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
Trang 39Structured 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
Trang 40CASE 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.
Trang 41An 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
Trang 42Analysis workbench components
• Diagram editors
• Model analysis and checking tools
• Repository and associated query language
• Data dictionary
• Data dictionary
• Report definition and generation tools
• Forms definition tools
• Import/export translators
• Code generation tools
Trang 43• State machine models model the system’s behaviour
in response to internal or external events
Trang 44Key points
• Semantic data models describe the logical structure
of data which is imported to or exported by the
• Structured methods provide a framework for
developing system models.
Trang 45Bà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: http://bbc.vnu.edu.vn
– Học sử dụng Enterprise Architecture của sparxsystems
– 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