System models September 29 2008 Ian Sommerville 2004
System models September 29, 2008 ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 1
System modelling l System modelling helps the analyst to understand the functionality of the system and models are used to communicate with customers. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 2
System models l Different models present the system from different perspectives • External (or Context) perspective • Show the system’s context or environment; • Behavioural perspective • Show the behaviour of the system; • Structural perspective • Show the system or data architecture. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 3
Model types l Data processing model • l Composition model • l Shows how data is processed at different stages Shows how entities are composed of other entities Architectural model • Shows principal sub-systems ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 4
Model types l Classification model • l Shows how entities have common characteristics Stimulus/response model • Shows the system’s reaction to events. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 5
Context Models ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 6
Context models l Context models • • l l Illustrate the operational context of a system Show what lies outside system boundaries Social and organisational concerns may affect the decision on where to position system boundaries. Ideally, the boundaries between the system and its environment are identified clearly. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 7
Context models l Various models can be used for context modeling: • Very simple, high-level architectural models • Show the system and its connections with environmental components • High-level process models • Indicate main process activities • High-level data-flow diagrams • Depict data transformations and data transfers ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 8
The context of an ATM system ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 9
Process models l Process models • l Show the overall process and the processes that are supported by the system. Data flow models may be used to show the processes and the flow of information from one process to another. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 10
Equipment procurement process ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 11
Behavioral Models ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 12
Behavioural models l Behavioural models • l Describe overall behaviour of a system. Two types of behavioural model are: • • Data processing models State machine models ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 13
Data-processing models l Data flow diagrams (DFDs) • l Used to model the system’s data processing. Show processing steps as data flows through a system. l Part of many analysis methods. l Simple and intuitive notation l Show end-to-end processing of data. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 14
Order processing DFD ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 15
Data flow diagrams l l Model systems from a functional perspective. May show data exchange between a system and other systems in its environment. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 16
Insulin pump DFD ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 17
State machine models l Model the behaviour of the system in response to external and internal events. l Show the system’s responses to stimuli l Often used for modelling real-time systems. l Show system states as nodes and events as arcs between these nodes. • When an event occurs, the system moves from one state to another. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 18
Statecharts l l l Allow the decomposition of a model into submodels. 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. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 19
Microwave oven model ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 20
Microwave oven state description ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 21
Microwave oven stimuli ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 22
Microwave oven operation ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 23
Semantic data models l Describe the logical structure of data processed by the system. l Entity-relation-attribute (ERA) model l Widely used in database design. • Can readily be implemented using relational databases. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 24
Library semantic model ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 25
Data dictionaries l Lists of all of the names used in the system models. • l Advantages • • l Descriptions of the entities, relationships and attributes are also included. Support name management and avoid duplication; Store of organisational knowledge linking analysis, design and implementation; Many CASE workbenches support data dictionaries. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 26
Data dictionary entries ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 27
Object models l l l Describe the system in terms of object classes and their associations. An object class is an abstraction over a set of objects with common attributes and the services (operations) provided by each object. Various object models may be produced • • • Inheritance models; Aggregation models; Interaction models. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 28
Distinguishing Principles of OO l Principles that distinguish object-orientation from function-orientation (imperative programming) • • • Encapsulation Inheritance Polymorphism ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 29
Types of Relationships in OO 1. “is a” - inheritance 2. “has a” - encapsulation (aggregation) 3. “association” - anything else ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 30
Object models l Natural ways of reflecting the real-world entities manipulated by the system • l Object class identification is recognised as a difficult process • l More abstract entities are more difficult to model using this approach Requires a deep understanding of the application domain Object classes reflecting domain entities are reusable across systems ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 31
Inheritance models l l Organise the domain object classes into a hierarchy. Classes at the top of the hierarchy reflect the common features of all classes. • l Object classes inherit their attributes and services from one or more super-classes. these may then be specialised as necessary. Class hierarchy design can be a difficult process if duplication in different branches is to be avoided. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 32
Object models and the UML l l The UML is a standard representation devised by the developers of widely used object-oriented analysis and design methods. It has become an effective standard for object-oriented modelling. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 33
Library class hierarchy ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 34
User class hierarchy ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 35
Multiple inheritance l l l Rather than inheriting the attributes and services from a single parent class, a system which supports multiple inheritance allows object classes to inherit from several super-classes. This can lead to semantic conflicts where attributes/services with the same name in different super-classes have different semantics. Multiple inheritance makes class hierarchy reorganisation more complex. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 36
Multiple inheritance ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 37
Object aggregation l l An aggregation model shows how classes that are collections are composed of other classes. Aggregation models are similar to the part-of relationship in semantic data models. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 38
Object aggregation ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 39
Object behaviour modelling l l Shows interactions between objects. Sequence diagrams (or collaboration diagrams) in the UML are used to model interaction between objects. ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 40
Issue of electronic items ©Ian Sommerville 2004 Software Engineering, 7 th edition. Chapter 8 Slide 41
- Slides: 41