CS 425625 Software Engineering System Models Based on

  • Slides: 29
Download presentation
CS 425/625 Software Engineering System Models Based on Chapter 7 of the textbook [Somm

CS 425/625 Software Engineering System Models Based on Chapter 7 of the textbook [Somm 00] Ian Sommerville, Software Engineering, 6 th Ed. , Addison-Wesley, 2000 and on Ch 7 Power. Point presentation available at the book’s web-site: www. comp. lancs. ac. uk/computing/resources/Ian. S/SE 6/Slides/index. html September 29, 2003 1

Outline n System Models u Contextual Models u Behavioral Models u Data Models u

Outline n System Models u Contextual Models u Behavioral Models u Data Models u Object Models 2

Introduction. n n n System models are used to specify the system to be

Introduction. n n n System models are used to specify the system to be built in a more detailed way Typically, system models are graphical descriptions of the system, its services and its constraints Various perspectives for system modeling: Context u Behavior u Structure u 3

. Introduction n The production of system models is usually guided by methods, e.

. Introduction n The production of system models is usually guided by methods, e. g. , SSA (Structured Systems Analysis), SADT (Structured Analysis and Design Technique), OMT (Object Modeling Technique), etc. In practice, various models, not bound to methods, could be combined to describe the system and its requirements Main types of system models: u u u 4 Data Processing Models Composition Models Architectural Models Classification Models Stimulus-Response Models

Context Models… n n n 5 Contextual models show the system and its environment

Context Models… n n n 5 Contextual models show the system and its environment Ideally, the boundaries between the system and its environment are identified clearly Dependencies between the computer-based system and systems from the environment are highlighted

. Context Models. . n 6 Various models can be used for context modeling:

. Context Models. . n 6 Various models can be used for context modeling: u Very simple, high level architectural models show the system and its connections with environmental components u High level process models indicate main process activities u High-level data-flow diagrams depict data transformations and data transfers

. . Context Models. n 7 Example of architectural model for system context specification:

. . Context Models. n 7 Example of architectural model for system context specification: an ATM system and its environment [Fig. 7. 1, Somm 00]

…Context Models n 8 Example of process model for system context specification: an equipment

…Context Models n 8 Example of process model for system context specification: an equipment procurement system [Fig. 7. 2, Somm 00]

Behavioral Models……. n Behavioral models specify the overall behavior of the system: u Data-flow

Behavioral Models……. n Behavioral models specify the overall behavior of the system: u Data-flow models (or data-flow diagrams, DFD) are suitable for data-driven systems u State machine models (or stimulus-response models) are appropriate for event-driven systems 9

. Behavioral Models…. . . n Data-flow models show the system in terms of:

. Behavioral Models…. . . n Data-flow models show the system in terms of: u Data stores [graphical representation: rectangles] u Data transformations (data processing operations) [graphical representation: rounded rectangles] u Data movements (data transfers) [graphical representation: directed lines] 10

. . Behavioral Models…. . n State machine models describe system behavior using two

. . Behavioral Models…. . n State machine models describe system behavior using two main modeling elements: u States [represented using rounded rectangles] u Transitions [shown as directed links between states] 11

…Behavioral Models. . n 12 A DFD example: an order processing system [Fig. 7.

…Behavioral Models. . n 12 A DFD example: an order processing system [Fig. 7. 3, Somm 00]

…. Behavioral Models… n n 13 State machine diagrams depict the behavior of the

…. Behavioral Models… n n 13 State machine diagrams depict the behavior of the system in terms of responses to events Real-time systems are essentially event-driven systems The system is assumed to be in one of its possible states at any given moment of time. A transition to another state is triggered by the occurrence of an event David Harel’s statecharts are included in the UML (Unified Modeling Language); DFDs are not part of UML

…. . Behavioral Models. . n 14 Example of state machine diagram: A microwave

…. . Behavioral Models. . n 14 Example of state machine diagram: A microwave oven controller [Fig. 7. 5, Somm 00]

…. . . Behavioral Models. n The statecharts notation used in UML allows: u

…. . . Behavioral Models. n The statecharts notation used in UML allows: u Specification of composite states (states that have sub-states), thus supporting model decomposition u Description of actions performed while in a state: § § § Entry actions State actions (activities) Exit actions u Description of transitions: § Events that trigger the transition § Conditions under which transitions occur § Actions on transitions, if any 15

…. . Behavioral Models n 16 Example of composite state: microwave oven [Fig. 7.

…. . Behavioral Models n 16 Example of composite state: microwave oven [Fig. 7. 7, Somm 00]

Semantic Data Models… n n Data models describe the logical structure of data processed

Semantic Data Models… n n Data models describe the logical structure of data processed by the system The Entity-Relationship-Attribute model, ERA (also known as Entity-Relationship model, ER) shows: u Entities in the system u Relationships between entities u Attributes of entities and relationships u Cardinality constraints (e. g. , “one” or “many”) 17

. Semantic Data Models. . n 18 Data dictionaries are repositories of information pertaining

. Semantic Data Models. . n 18 Data dictionaries are repositories of information pertaining to the elements of the system models. They are useful to manage the namespace of the system models as well as to supply a cross-reference tool for analysis, design, implementation, and evolution.

. . Semantic Data Models. n 19 An ERA example: a software design description

. . Semantic Data Models. n 19 An ERA example: a software design description [Fig. 7. 8, Somm 00]

…Semantic Data Models n 20 Data dictionary: examples of data entries [Fig. 7. 9,

…Semantic Data Models n 20 Data dictionary: examples of data entries [Fig. 7. 9, Somm 00]

Object Models……. . n n 21 Objected-oriented modeling is centered around the concepts of

Object Models……. . n n 21 Objected-oriented modeling is centered around the concepts of object and class An object is an entity described in terms of attributes (data) and operations (functionality) A class is a template for objects that have similar features (attributes and operations). More exactly, the objects that belong to the same class have the same structure and behavior, e. g. , davids. Alarm. Clock is an object (instantiation) of the class Alarm. Clock

. Object Models……. n The distinguishing principles of objectoriented (OO) technology are: u Encapsulation

. Object Models……. n The distinguishing principles of objectoriented (OO) technology are: u Encapsulation u Inheritance u Polymorphism 22

. . Object Models…… n n n Objects provide more natural ways to model

. . Object Models…… n n n Objects provide more natural ways to model reallife entities Both structure (class diagrams) and behavior (e. g. , interaction diagrams and state diagrams) can be described A class diagram shows: u Classes u Relationships u Constraints u Annotations 23 between classes

…Object Models…. . n The value of OO comes from: u Greater modeling power

…Object Models…. . n The value of OO comes from: u Greater modeling power u Increased reusability and extensibility u Improved control of complexity 24

…. Object Models…. n 25 Example of class hierarchy: a library system [Fig. 7.

…. Object Models…. n 25 Example of class hierarchy: a library system [Fig. 7. 10, Somm 00]

…. . Object Models… n Another example of class hierarchy: Library users [Fig. 7.

…. . Object Models… n Another example of class hierarchy: Library users [Fig. 7. 11, Somm 00] 26

……Object Models. . n 27 Example of multiple inheritance [Fig. 7. 12, Somm 00]

……Object Models. . n 27 Example of multiple inheritance [Fig. 7. 12, Somm 00]

……. Object Models. n 28 Example of class structure with aggregation [Fig. 7. 13,

……. Object Models. n 28 Example of class structure with aggregation [Fig. 7. 13, Somm 00]

……. . Object Models n Example of sequence diagram [Fig. 7. 14, Somm 00]

……. . Object Models n Example of sequence diagram [Fig. 7. 14, Somm 00] 29