Chapter 5 System modeling Chapter 5 – System Modeling Lecture 2 1.

Slides:



Advertisements
Similar presentations
Chapter 5 – System Modeling
Advertisements

Figures – Chapter 5. Figure 5.1 The context of the MHC-PMS.
Informática II Prof. Dr. Gustavo Patiño MJ
CSC 506: Software Engineering and Knowledge Engineering
Object Oriented Analysis and Design Using the UML
Chapter 5 – System Modeling 1Chapter 5 System modeling.
Chapter 5 System modeling Chapter 5 – System Modeling Lecture 1 1.
Structured Vs. Object Oriented Analysis and Design SAD Vs. OOAD
CS451 Introduction to Software Engineering Behavioral Modeling.
Software Engineering 8. System Models.
Chapter 5 – System Modeling
Chapter 5 – System Modeling 1Chapter 5 System modeling.
Chapter 5 – System Modeling Lecture 1 1Chapter 5 System modeling.
Chapter 5 – System Modeling
Chapter 4 System Models A description of the various models that can be used to specify software systems.
Lecture 6 Systems Modeling
Chapter 5 – System Modeling
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Chapter 5 – System Modeling
Chapter 5 – System Modeling 1Chapter 5 System modeling CS 425 October 13, 2011 Ian Sommerville, Software Engineering, 9 th Edition Pearson Education, Addison-Wesley.
 Chapter 5 System Modeling 1. Context Model  Shows context (environment) of proposed system  Other software  People  Roadmap of major areas to consider.
Chapter 7 System models.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Software Engineering, 8th edition Chapter 8 1 Courtesy: ©Ian Somerville 2006 April 06 th, 2009 Lecture # 13 System models.
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Chapter 5 System Modeling (2/2) Yonsei University 2 nd Semester, 2014 Sanghyun Park.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
Object Oriented Analysis & Design Using UML (CS-512) M-Tech CSE (Ist & 3rd Sem) Part Time Mr. Pawan Luthra Assistant Professor (CSE Deptt.) SBSSTC, Ferozepur.
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Chapter 5 – System Modeling Chapter 5 System Modeling1 CS 425 October 20, 2015 Ian Sommerville, Software Engineering, 10 th Edition Pearson Education,
OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 1 Object Oriented Analysis.
Chapter 5 – System Modeling 1Chapter 5 System modeling CS 425 October 18, 2010 Ian Sommerville, Software Engineering, 9 th Edition Pearson Education, Addison-Wesley.
Chapter 5 – System Modeling
Unit 4 – System Modeling 1Chapter 5 System modeling.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Chapter 5 – System Modeling Chapter 5 System Modeling130/10/2014.
Object Oriented Analysis and Design Using the UML
Software Engineering Lecture 6 – System Modelling
Chapter 5 – System Modeling Lecture 9 Section A 27/4/2015 Section B 29/4/2015 1Chapter 5 System modeling.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Lecturer: Eng. Mohamed Adam Isak PH.D Researcher in CS M.Sc. and B.Sc. of Information Technology Engineering, Lecturer in University of Somalia and Mogadishu.
Chapter 5 – System Modeling Lecture 1 1Chapter 5 System modeling.
Engineering, 7th edition. Chapter 8 Slide 1 System models.
EKT 421 SOFTWARE ENGINEERING
Chapter 5 – System Modeling
Chapter 5 System Modeling
CompSci 280 S Introduction to Software Development
Object-oriented and Structured System Models
Chapter 5 System modeling
The Movement To Objects
Unified Modeling Language
Chapter 5 – System Modeling
System Modeling Chapter 4
Abstract descriptions of systems whose requirements are being analysed
Software Engineering Chapter 5 (Part 3) System Modeling Dr.Doaa Sami.
Object Oriented Analysis and Design Using the UML
UML Class Diagram.
Chapter 5 – System Modeling
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Software Construction Lecture 2
CS310 Software Engineering Dr.Doaa Sami
Chapter 5 – System Modeling
Copyright 2007 Oxford Consulting, Ltd
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Chapter 5 – System Modeling
Chapter 4 System Modeling.
Appendix A Object-Oriented Analysis and Design
Chapter 5 – System Modeling
Presentation transcript:

Chapter 5 System modeling Chapter 5 – System Modeling Lecture 2 1

Chapter 5 System modeling 3. Structural Models  Structural models of software display the organization of a system in terms of the components and their relationships.  Structural models may be static models, which show the structure of the system design, or dynamic models, which show the organization of the system when it is executing.  Structural models are created when discussing and designing the system architecture. 2

Chapter 5 System modeling Class Diagrams  Class diagrams are used when developing an object-oriented system model to show the classes in a system and the associations between these classes.  An association is a link between classes that indicates that there is some relationship between these classes.  When you are developing models during the early stages of the software engineering process, objects represent something in the real world, such as a patient, a prescription, doctor, a device, etc.  We have spoken in terms of 'nouns' or 'things.' 3

Chapter 5 System modeling UML classes and association 4 Here we are also showing multiplicity: one object of type Patient is related to one object of type Patient Record

Chapter 5 System modeling Classes and Associations in the MHC-PMS 5 Notice that this is s Static Model Notice the associations are labeled Notice the multiplicity.

Chapter 5 System modeling The Consultation Class (There are all kinds of classes: domain / entity classes; software classes, and many 'levels' of these! 6 This is a high level class – perhaps a first or second cut at class definition. Notice much is missing, such as parameters, returns, etc. from the methods. These are ‘software classes’ because they contain methods (that is, how the attributes will be used / manipulated.) Finer levels of granularity are needed to address the shortcomings of this class. But this is a very good way to start your analysis and class definition, especially when trying to develop classes from use cases, where nouns (Consultation) and verbs (new, prescribe….) will be found in the use case itself.

Chapter 5 System modeling Generalization  Generalization is an everyday technique that we use to  Rather than learn the detailed characteristics of every entity that we experience, we place these entities in more general classes (animals, cars, houses, etc.) and learn the characteristics of these classes.  This allows us to infer that different members of these classes have some common characteristics e.g. squirrels and rats are rodents.  In programming, we refer to this as 'inheritance.'  Base class and derived classes, or super class and derived class.... parent and child.... many terms for capturing these important relationships. 7

Chapter 5 System modeling Generalization  In modeling systems, it is often useful to examine the classes in a system to see if there is scope for generalization.  In object-oriented languages, such as Java, generalization is implemented using the class inheritance mechanisms built into the language.  In a generalization, the attributes and operations associated with higher-level classes are also associated with (inherited by) the lower-level classes.  The lower-level classes are subclasses inherit the attributes and operations from their superclasses. These lower-level classes then add more specific attributes and operations. 8

Relationships: Generalization A relationship among classes where one class shares the structure and/or behavior of one or more classes Defines a hierarchy of abstractions in which a subclass inherits from one or more superclasses Single inheritance Multiple inheritance Generalization is an “is-a-kind of” relationship, or simply, “is_a” relationship.

Account balance name number Withdraw() CreateStatement() Checking Withdraw() Savings GetInterest() Withdraw() Superclass (parent) Subclasses Generalization Relationship Subclasses inherit both attributes and methods from base (parent) class. Descendents Example: Single Inheritance One class inherits from another

AirplaneHelicopterWolfHorse FlyingThingAnimal Bird multiple inheritance Use multiple inheritance only when needed, and always with caution ! Example: Multiple Inheritance A class can inherit from several other classes

Inheritance leverages the similarities among classes What Gets Inherited? A subclass inherits its parent’s attributes, operations, and relationships A subclass may: Add additional attributes, operations, relationships Redefine inherited operations (use caution!) Common attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchy

Truck tonnage GroundVehicle weight licenseNumber Car owner register( ) getTax( ) Person 0..* Trailer 1 Superclass (parent) Subclass generalization size Example: What Gets Inherited

Chapter 5 System modeling Object class aggregation models  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. 14

Relationships Association Aggregation Composition Dependency Generalization Realization

Professor University Works for Class Association Association Name ProfessorUniversity EmployerEmployee Role Names Relationships: Association Models a semantic connection among classes

StudentSchedule Whole Aggregation This is sometimes called a ‘has_a’ relationship Part Relationships: Aggregation A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts

StudentSchedule Whole Aggregation Part Relationships: Composition A form of aggregation with strong ownership and coincident lifetimes The parts cannot survive the whole/aggregate

Association: Multiplicity and Navigation Multiplicity defines how many objects participate in a relationships The number of instances (that is, ‘objects’) of one class related to ONE instance of another class Specified for each end of the association Associations and aggregations are bi-directional by default, but it is often desirable to restrict navigation to one direction If navigation is restricted, an arrowhead is added to indicate the direction of the navigation

Association: Multiplicity * 0..* 1 * Unspecified Exactly one Zero or more (many, unlimited) One or more Zero or one Specified range Multiple, disjoint ranges 2, 4..6

Truck tonnage GroundVehicle weight licenseNumber Car owner register( ) getTax( ) Person 0..* Trailer 1 Superclass (parent) Subclass generalization size Example: What Gets Inherited

Chapter 5 System modeling Key points  Structural models show the organization and architecture of a system. Class diagrams are used to define the static structure of classes in a system and their associations. 22

Chapter 5 System modeling 4. Behavioral Models  Behavioral models are models of the dynamic behavior of a system as it is executing. They show what happens or what is supposed to happen when a system responds to a stimulus from its environment.  You can think of these stimuli as being of two types:  A. Data Some data arrives that has to be processed by the system.  B. Events Some event happens that triggers system processing. Events may have associated data, although this is not always the case. 23

Chapter 5 System modeling A. Data-driven Modeling  Many business systems are data-processing systems that are primarily driven by data.  They are controlled by the data input to the system, with relatively little external event processing.  Data-driven models show the sequence of actions involved in processing input data and generating an associated output.  They are particularly useful during the analysis of requirements as they can be used to show end-to-end processing in a system. 24

Chapter 5 System modeling An Activity Model of the insulin pump’s operation 25 These are used a lot! They are not flowcharts or flowgraphs; merely ‘activities’ that need to or must take place. (This is an example (later) of a Pipe-Filter Architectural Model)

Chapter 5 System modeling Order Processing – Sequence Diagram - behavorial 26 Shows the Sequence of events over time as messages are issued from one object to another. Terms: life of the object; lifelines, actors, unnamed objects, recursion, and more. Very Important to show the scenarios in motion. Dynamic!

Chapter 5 System modeling B. Event-Driven Modeling  Real-time systems are often event-driven, with minimal data processing.  For example, a landline phone switching system responds to events such as ‘receiver off hook’ by generating a dial tone.  Event-driven modeling shows how a system responds to external and internal events.  It is based on the assumption that a system has a finite number of states and that events (stimuli) may cause a transition from one state to another. 27

Chapter 5 System modeling State Machine Models  These model the behaviour of the system in response to external and internal events.  They show the system’s responses to stimuli so are often used for modeling real-time systems.  State machine models 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 are an integral part of the UML and are used to represent state machine models. 28

Chapter 5 System modeling State Diagram of a Mocrowave oven 29

Chapter 5 System modeling States and stimuli for the microwave oven (a) StateDescription WaitingThe oven is waiting for input. The display shows the current time. Half powerThe oven power is set to 300 watts. The display shows ‘Half power’. Full powerThe oven power is set to 600 watts. The display shows ‘Full power’. Set timeThe 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. DisabledOven operation is disabled for safety. Interior oven light is on. Display shows ‘Not ready’. EnabledOven operation is enabled. Interior oven light is off. Display shows ‘Ready to cook’. OperationOven in operation. Interior oven light is on. Display shows the timer countdown. On completion of cooking, the buzzer is sounded for five seconds. Oven light is on. Display shows ‘Cooking complete’ while buzzer is sounding. 30

Chapter 5 System modeling States and stimuli for the microwave oven (b) StimulusDescription Half powerThe user has pressed the half-power button. Full powerThe user has pressed the full-power button. TimerThe user has pressed one of the timer buttons. NumberThe user has pressed a numeric key. Door openThe oven door switch is not closed. Door closedThe oven door switch is closed. StartThe user has pressed the Start button. CancelThe user has pressed the Cancel button. 31

Chapter 5 System modeling Microwave Oven Operation 32

Chapter 5 System modeling 5. Model-Driven Engineering  Model-driven engineering (MDE) is an approach to software development where models rather than programs are the principal outputs of the development process.  Programs execute on a hardware/software platform are generated automatically from the models.  Proponents of MDE argue that this raises the level of abstraction in software engineering so that engineers no longer have to be concerned with programming language details or the specifics of execution platforms. 33

Chapter 5 System modeling Usage of Model-Driven Engineering  Model-driven engineering is still at an early stage of development, and it is unclear whether or not it will have a significant effect on software engineering practice.  Pros  Allows systems to be considered at higher levels of abstraction  Generating code automatically means that it is cheaper to adapt systems to new platforms.  Cons  Models for abstraction and not necessarily right for implementation.  Savings from generating code may be outweighed by the costs of developing translators for new platforms. 34

Chapter 5 System modeling Model driven architecture  Model-driven architecture (MDA) was the precursor of more general model-driven engineering  MDA is a model-focused approach to software design and implementation that uses a subset of UML models to describe a system.  Models at different levels of abstraction are created. From a high-level, platform independent model, it is possible, in principle, to generate a working program without manual intervention. 35

Chapter 5 System modeling Examples  IEF Information Engineering Facility  Rational Rose  Others… 36

Chapter 5 System modeling Key points  Behavioral models are used to describe the dynamic behavior of an executing system. This behavior can be modeled from the perspective of the data processed by the system, or by the events that stimulate responses from a system.  Activity diagrams may be used to model the processing of data, where each activity represents one process step.  State diagrams are used to model a system’s behavior in response to internal or external events.  Model-driven engineering is an approach to software development in which a system is represented as a set of models that can be automatically transformed to executable code. 37

Chapter 5 System modeling On Your Own  Good Stuff.  Be sure to read through this casually… 38

Chapter 5 System modeling Types of model  A computation independent model (CIM)  These model the important domain abstractions used in a system. CIMs are sometimes called domain models.  A platform independent model (PIM)  These model the operation of the system without reference to its implementation. The PIM is usually described using UML models that show the static system structure and how it responds to external and internal events.  Platform specific models (PSM)  These are transformations of the platform-independent model with a separate PSM for each application platform. In principle, there may be layers of PSM, with each layer adding some platform-specific detail. 39

Chapter 5 System modeling MDA transformations 40

Chapter 5 System modeling Multiple platform-specific models 41

Chapter 5 System modeling Agile methods and MDA  The developers of MDA claim that it is intended to support an iterative approach to development and so can be used within agile methods.  The notion of extensive up-front modeling contradicts the fundamental ideas in the agile manifesto and I suspect that few agile developers feel comfortable with model- driven engineering.  If transformations can be completely automated and a complete program generated from a PIM, then, in principle, MDA could be used in an agile development process as no separate coding would be required. 42

Chapter 5 System modeling Executable UML  The fundamental notion behind model-driven engineering is that completely automated transformation of models to code should be possible.  This is possible using a subset of UML 2, called Executable UML or xUML. 43

Chapter 5 System modeling Features of executable UML  To create an executable subset of UML, the number of model types has therefore been dramatically reduced to these 3 key types:  Domain models that identify the principal concerns in a system. They are defined using UML class diagrams and include objects, attributes and associations.  Class models in which classes are defined, along with their attributes and operations.  State models in which a state diagram is associated with each class and is used to describe the life cycle of the class.  The dynamic behavior of the system may be specified declaratively using the object constraint language (OCL), or may be expressed using UML’s action language. 44

Chapter 5 System modeling Key points  Behavioral models are used to describe the dynamic behavior of an executing system. This behavior can be modeled from the perspective of the data processed by the system, or by the events that stimulate responses from a system.  Activity diagrams may be used to model the processing of data, where each activity represents one process step.  State diagrams are used to model a system’s behavior in response to internal or external events.  Model-driven engineering is an approach to software development in which a system is represented as a set of models that can be automatically transformed to executable code. 45