Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.

Slides:



Advertisements
Similar presentations
ARCH-05 Application Prophecy UML 101 Peter Varhol Principal Product Manager.
Advertisements

Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
1 Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Introduction To System Analysis and Design
© 2005 Prentice Hall7-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Systems Analysis and Design in a Changing World, Fourth Edition
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 8 Slide 1 System models.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
© 2005 Prentice Hall4-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Component and Deployment Diagrams
Requirements Analysis 2 What objects collaborate to achieve the goal of a use case?
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
© Copyright Eliyahu Brutman Programming Techniques Course.
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
1 A Student Guide to Object- Orientated Development Chapter 9 Design.
8/7/2015CPSC , CPSC , Lecture 41 Software Engineering, CPSC , CPSC , Lecture 4.
Object Oriented Analysis and Design Using the UML
The chapter will address the following questions:
Chapter 7: The Object-Oriented Approach to Requirements
Chapter 10 Architectural Design
The Design Discipline.
Systems Analysis and Design in a Changing World, Fifth Edition
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
Chapter 4 System Models A description of the various models that can be used to specify software systems.
System models Abstract descriptions of systems whose requirements are being analysed Abstract descriptions of systems whose requirements are being analysed.
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.
©Ian Sommerville 1995/2000 (Modified by Spiros Mancoridis 1999) Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Chapter 7 System models.
Slide 1 System models. Slide 2 Objectives l To explain why the context of a system should be modelled as part of the RE process l To describe behavioural.
Modified by Juan M. Gomez Software Engineering, 6th edition. Chapter 7 Slide 1 Chapter 7 System Models.
Systems Analysis and Design in a Changing World, 3rd Edition
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 4: Restaurant.
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.
GRASP: Designing Objects with Responsibilities
2 Object-Oriented Analysis and Design and the Unified Process Objectives  Explain the purpose and objectives of object- oriented design  Develop design.
 Repository Model  Client-Server Model  Layered Model  Modular decomposition styles  Object Models  Function Oriented Pipelining  Control Styles.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Use Cases, Part I Understanding the Business Dynamics  Understand the business workflow  Identify system support points the system 'use cases'
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Systems Analysis and Design in a Changing World, Fourth Edition
Slide 1 Service-centric Software Engineering. Slide 2 Objectives To explain the notion of a reusable service, based on web service standards, that provides.
Analysis Yaodong Bi. Introduction to Analysis Purposes of Analysis – Resolve issues related to interference, concurrency, and conflicts among use cases.
UML - Development Process 1 Software Development Process Using UML.
 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.
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 17 Object-Oriented Design and Modeling Using the UML.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 6: Restaurant.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
Basic Characteristics of Object-Oriented Systems
11 Systems Analysis and Design in a Changing World, Fifth Edition.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Engineering, 7th edition. Chapter 8 Slide 1 System models.
The Object Oriented Approach to Design
Service-centric Software Engineering
Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
Design and Implementation
Design Yaodong Bi.
Chapter 6: Architectural Design
Software Architecture & Design
Presentation transcript:

Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant System: Analysis

Practical Object-Oriented Design with UML 2e Slide 1/2 ©The McGraw-Hill Companies, 2004 Analysis What is to be analyzed? –the system requirements Why? –to demonstrate their implementability How? –by drawing interaction diagrams realizing use cases

Practical Object-Oriented Design with UML 2e Slide 1/3 ©The McGraw-Hill Companies, 2004 Analysis v. Design Difficult to draw a boundary Traditional informal distinction: –analysis models the real-world system –design models the software Object-oriented methods use the same notation for both activities –encourages ‘seamless development’ and iteration

Practical Object-Oriented Design with UML 2e Slide 1/4 ©The McGraw-Hill Companies, 2004 Object Design We need to define attributes and operations for each class in the model Start from domain model, but: –structure of real-world application is not always the optimal structure for a software system –domain model does not show operations Realization identifies operations and confirms that design supports functionality

Practical Object-Oriented Design with UML 2e Slide 1/5 ©The McGraw-Hill Companies, 2004 Object Responsibilities Each class in a system should have well- defined responsibilities –to manage a subset of the data in the system –to manage some of the processing The responsibilities of a class should be cohesive –they should ‘belong together’ –they should form a sensible whole

Practical Object-Oriented Design with UML 2e Slide 1/6 ©The McGraw-Hill Companies, 2004 Software Architecture A software architecture a high level view of software, described as a number of of distinct components or subsystems together with their relationships and interaction. Description of UML component/deployment may be used to document architectures Architectures are the configurations of components that make up the systems. Architectural pattern is a high level pattern describing a solution at architectural level. Architectures are the configurations of components that make up the systems.

Practical Object-Oriented Design with UML 2e Slide 1/7 ©The McGraw-Hill Companies, 2004 Software Architecture A software architecture describes a configurations of a number of distinct components or subsystems together with their relationships and interaction. Or more simply, architectures are the configurations of components that make up the systems. Different Architectural Styles, such as client/server or layered, data centric, address different design problems.

Practical Object-Oriented Design with UML 2e Slide 1/8 ©The McGraw-Hill Companies, 2004 Software Architecture Types Data-flow: concentrates on the flow of data e.g. batch processing. Data-centered: focuses on centralised persistent data e.g. data base. Virtual-machine: layered software e.g. ISO OSI seven layer model. Call-return: focuses on a sequence of instruction, single thread of control. Independent-component: supports modifiability e.g. client server.

Practical Object-Oriented Design with UML 2e Slide 1/9 ©The McGraw-Hill Companies, 2004 UML and Architecture To be useful, architecture must be described in a clear, explicit way to serve as the basis for understanding, implementation reuse, and evolution of the system. In the UML packages, profiles, component and deployment diagrams may be used to document architectures. Designing the architecture of the system is part the RUP process (using packages and profiles etc). RUP considers architecture as central and is included in the process. The UML also provides an architectural view of how its own components fit together.

Practical Object-Oriented Design with UML 2e Slide 1/10 ©The McGraw-Hill Companies, 2004 Business Object A car hire company with branches at major airports plans to develop a web-based system to support customer-based functions, such as car hiring, and company focused activities, such as maintaining the vehicle fleet.

Practical Object-Oriented Design with UML 2e Slide 1/11 ©The McGraw-Hill Companies, 2004 Possible Business Object Customer : Someone who checks on the availability of cars, makes contractual arrangements for hiring cars, takes cars out, returns them, is billed for this service and who in turn makes payments. Without customers the business model would not make sense and could not function. Car : Cars are reserved for use, taken out (and returned) by customers, maintained and repaired. The business is a car hire business; without cars the business model would not make sense. Hire Contract : These are agreed between customers and the business. They are contractual arrangements for the provision of car rental services for a specified period of time. Hire contracts are fundamental to how the business operates and how operational data is recorded

Practical Object-Oriented Design with UML 2e Slide 1/12 ©The McGraw-Hill Companies, 2004 Possible Architecture A possible architectural approach is to structure a system as a number of tiers including presentation, application, and storage tier. All of these are supported by a layer of software which is relatively independent of a given application (e.g. networks and operating systems).

Practical Object-Oriented Design with UML 2e Slide 1/13 ©The McGraw-Hill Companies, 2004 Possible Architecture The use of a three tier architecture is the core of a distributed application. Presentations tier: HCI can go on the client and does not require to be transmitted over network. Usually a browser that can talk HTTP. The presentation tier should provide the essential logic for user interaction. The presentation tier would contain facilities which allow the user to interact with the stored data in the other tiers. Processing tier: Business objects reflect domain entities i.e. Customer, Car, and Hiring Business objects shield the implementation of data, they are not just reflections of database tables. The application tier provides the essential logic for the particular system. Data or storage tier should handle persistence, usually requires files or a database. Support layers software such as; middleware, operating systems, network software must be included.

Practical Object-Oriented Design with UML 2e Slide 1/14 ©The McGraw-Hill Companies, 2004 Three tier architecture

Practical Object-Oriented Design with UML 2e Slide 1/15 ©The McGraw-Hill Companies, 2004 Advantages of three-tier architecture A three-tier architecture is used mainly for maintenance reasons. Such an architecture allocates most of the code in the middle and data layer to the server, with the presentation layer residing on the client. This means that when a change occurs, for example a change to an object-to- database mapping, it only usually affects one copy of the software: the part residing on the server. It also means that when a change in functionality occurs the effect on the presentation layer is minimised. Other advantages tiers and layers– separation of function modular development building on work of others reusable components substitutable components use of standard protocols

Practical Object-Oriented Design with UML 2e Slide 1/16 ©The McGraw-Hill Companies, 2004 Tiers mapped to system functions ● The presentation tier would enabled the customer to: – create a car booking; – check car availability at a given airport ; ● The presentation tier would enabled the an employee to: – retrieve the current status of a car – check the history of a car ● The middle tier would contain business objects which would correspond to entities in the application. Typical business objects would include: – a cars details; – a booking details; – a maintenance history ; ● The database tier would usually contain relational tables which would store the business objects (need mapping between tables and objects). For example there would be a table which listed all the cars, customers, and a hiring related cars to cstomers. ● The support layers are important, but are usually support and are more concerned with implementation rather than analysis. However, they still provide the architecture with the advantage of reuse in general purpose features.

Practical Object-Oriented Design with UML 2e Slide 1/17 ©The McGraw-Hill Companies, 2004 Software Architecture The UP analysis workflow includes the production of an architectural description This defines: –the top-level structure of subsystems –the role and interaction of these subsystems Typical architectures are codified in patterns –for example, layered architectures

Practical Object-Oriented Design with UML 2e Slide 1/18 ©The McGraw-Hill Companies, 2004 A Layered Architecture Subsystems are shown as UML packages linked by dependencies A dependency without a stereotype means uses

Practical Object-Oriented Design with UML 2e Slide 1/19 ©The McGraw-Hill Companies, 2004 Separation of Concerns Layers aim to insulate a system from the effects of change For example, user interfaces often change –but the application layer does not use the presentation layer –so changes to system should be restricted to presentation layer classes Similarly, details of persistent data storage are separated from application logic

Practical Object-Oriented Design with UML 2e Slide 1/20 ©The McGraw-Hill Companies, 2004 Analysis Class Stereotypes Within this architecture objects can have various typical roles –boundary objects interact with outside actors –control objects manage use case behaviour –entity objects maintain data These are represented explicitly in UML by using analysis class stereotypes

Practical Object-Oriented Design with UML 2e Slide 1/21 ©The McGraw-Hill Companies, 2004 Class Stereotype Notation Stereotypes can be text or a graphic icon The icon can replace the normal class box

Practical Object-Oriented Design with UML 2e Slide 1/22 ©The McGraw-Hill Companies, 2004 Class Stereotype Notation Entities (model) Objects representing system data, often from the domain model. Boundaries (view) Objects that interface with system actors (e.g. a user or external service). Windows, screens and menus are examples of boundaries that interface with users.

Practical Object-Oriented Design with UML 2e Slide 1/23 ©The McGraw-Hill Companies, 2004 Class Stereotype Notation Controls (controller) Objects that mediate between boundaries and entities. These serve as the glue between boundary elements and entity elements, implementing the logic required to manage the various elements and their interactions. It is important to understand that you may decide to implement controllers within your design as something other than objects – many controllers are simple enough to be implemented as a method of an entity or boundary class for example.

Practical Object-Oriented Design with UML 2e Slide 1/24 ©The McGraw-Hill Companies, 2004 Restaurant Domain Model(4.10)

Practical Object-Oriented Design with UML 2e Slide 1/25 ©The McGraw-Hill Companies, 2004 Restaurant Use Case Diagram(4.7)

Practical Object-Oriented Design with UML 2e Slide 1/26 ©The McGraw-Hill Companies, 2004 Use Case Realization Begin with functionality in application layer ‘Display Bookings’: simple dialogue –the user provides the required date –the system response is to update the display Initial realization consists of –instance of the ‘Staff’ actor –an object representing the system –message(s) passed between them

Practical Object-Oriented Design with UML 2e Slide 1/27 ©The McGraw-Hill Companies, 2004 System Messages System messages are sent by an actor Represent system by a controller –initially analysing use case behaviour, not I/O –(Fig. 5.3)

Practical Object-Oriented Design with UML 2e Slide 1/28 ©The McGraw-Hill Companies, 2004 Sequence Diagrams Time passes from top to bottom Instances of classes and actors at top –only show those participating in this interaction –each instance has a lifeline Messages shown as arrows between lifelines –labelled with operation name and parameters –return messages (dashed) show return of control –activations show when receiver has control

Practical Object-Oriented Design with UML 2e Slide 1/29 ©The McGraw-Hill Companies, 2004 Accessing Bookings How does the system retrieve the bookings to display? Which object should have the responsibility to keep track of all bookings ? –if this was an additional responsibility of the ‘BookingSystem’ object it would lose cohesion –so define a new ‘Restaurant’ object with the responsibility to manage booking data

Practical Object-Oriented Design with UML 2e Slide 1/30 ©The McGraw-Hill Companies, 2004 Retrieving Bookings Add a message to get relevant bookings ‘updateDisplay’ is an internal message (fig. 5.4)

Practical Object-Oriented Design with UML 2e Slide 1/31 ©The McGraw-Hill Companies, 2004 Retrieving Booking Details Dates of individual bookings will need to be checked by the ‘Restaurant’ object (fig. 5.5)

Practical Object-Oriented Design with UML 2e Slide 1/32 ©The McGraw-Hill Companies, 2004 Refining the Domain Model This realization has involved: –new 'Restaurant' and 'BookingSystem' classes, with an association between them –an association from ‘Restaurant’ to ‘Booking’ ‘Restaurant’ maintains links to all bookings messages sent from restaurant to bookings –an association from ‘BookingSystem’ to ‘Booking’ ‘BookingSystem’ maintains links to currently displayed bookings

Practical Object-Oriented Design with UML 2e Slide 1/33 ©The McGraw-Hill Companies, 2004 Updated Class Diagram Operations are derived from messages sent to the instances of a class (fig. 5.6)

Practical Object-Oriented Design with UML 2e Slide 1/34 ©The McGraw-Hill Companies, 2004 Recording New Bookings Give ‘Restaurant’ responsibility for creation don’t model details of user input or data yet (fig. 5.7)

Practical Object-Oriented Design with UML 2e Slide 1/35 ©The McGraw-Hill Companies, 2004 Creating a New Booking Bookings must be linked to table and customer objects –responsibility of ‘Restaurant’ to retrieve these, given identifying data in booking details New objects shown at point of creation –lifeline starts from that point –objects created by a message arriving at the instance (a constructor)

Practical Object-Oriented Design with UML 2e Slide 1/36 ©The McGraw-Hill Companies, 2004 Creating a New Booking This completes the previous diagram (fig. 5.8)

Practical Object-Oriented Design with UML 2e Slide 1/37 ©The McGraw-Hill Companies, 2004 Cancelling a Booking A three-stage process: –select on screen the booking to be cancelled –confirm cancellation with user –delete the corresponding booking object Object deletion represented by a message with a ‘destroy’ stereotype –lifeline terminates with an ‘X’ Role names used to distinguish selected object from others displayed

Practical Object-Oriented Design with UML 2e Slide 1/38 ©The McGraw-Hill Companies, 2004 Cancelling a Booking (fig 5.9)

Practical Object-Oriented Design with UML 2e Slide 1/39 ©The McGraw-Hill Companies, 2004 Refining the Domain Model (2) ‘BookingSystem’ has the responsibility to remember which booking is selected Add an association to record this (Fig. 5.10)

Practical Object-Oriented Design with UML 2e Slide 1/40 ©The McGraw-Hill Companies, 2004 Recording Arrival (5.11) Selected booking must be a reservation

Practical Object-Oriented Design with UML 2e Slide 1/41 ©The McGraw-Hill Companies, 2004 Class Interface Design Should ‘setArrivalTime’ be defined in Booking or Reservation class? –on the one hand, it doesn't apply to walk-ins –but we want to preserve a common interface to all bookings if possible Define operation in ‘Booking’ class –default implementation does nothing –override in ‘Reservation’ class

Practical Object-Oriented Design with UML 2e Slide 1/42 ©The McGraw-Hill Companies, 2004 Refined Class Hierarchy (5.12)

Practical Object-Oriented Design with UML 2e Slide 1/43 ©The McGraw-Hill Companies, 2004 Summary Analysis has led to: –a set of use case realizations –a refined class diagram We can see how the class design is going to support the functionality of the use cases This gives confidence that the overall design will work

Practical Object-Oriented Design with UML 2e Slide 1/44 ©The McGraw-Hill Companies, 2004 Summary Analysis can be defined as the activity of representing the application domain and the system’s requirement in terms of the object model The basic analysis technique is the production of use case realizations, which demonstrate how the functionality specified in a use case could be delivered by a set of interacting objects.

Practical Object-Oriented Design with UML 2e Slide 1/45 ©The McGraw-Hill Companies, 2004 Summary Realizations can be documented using one of the forms of interaction diagram defined in UML i.e. collaboration or sequence diagrams. Producing use case realizations will suggest changes in the domain model, which will evolve into more detailed analysis class model. A central metaphor of object design is to make objects responsible for a subset of the data and operations in the system.

Practical Object-Oriented Design with UML 2e Slide 1/46 ©The McGraw-Hill Companies, 2004 Summary The Unified Process includes an architectural description as one of the product analysis. A widely used architectural approach is to structure a system as a number of layers, for example presentation, application, and storage layer. The objects in a system can be assigned a number of roles, to clarify the organization of the system. UML defines class stereotypes boundary, control and entity objects

Practical Object-Oriented Design with UML 2e Slide 1/47 ©The McGraw-Hill Companies, 2004 Summary User interaction can be shown on realizations by means of system messages received by control objects. There can be one control object per use case or one representing the system as a whole.

Practical Object-Oriented Design with UML 2e Slide 1/48 ©The McGraw-Hill Companies, 2004 Complete Analysis Class Model (5.13)