McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 18 Object-Oriented Design and Modeling Using the UML.

Slides:



Advertisements
Similar presentations
Karolina Muszyńska Based on:
Advertisements

18-1 Verifying Object Behavior and Collaboration Role playing – the act of simulating object behavior and collaboration by acting out an object’s behaviors.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
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.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 18 Object-Oriented Design and Modeling Using the UML.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Design Patterns. What are design patterns? A general reusable solution to a commonly occurring problem. A description or template for how to solve a problem.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
Unified Modeling Language
Object-Oriented Analysis and Design
The chapter will address the following questions:
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Chapter 7: The Object-Oriented Approach to Requirements
Introduction To System Analysis and design
The Design Discipline.
Systems Analysis and Design in a Changing World, Fifth Edition
Systems Analysis and Design in a Changing World, Fifth Edition
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
12 Systems Analysis and Design in a Changing World, Fifth Edition.
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.
Systems Analysis and Design in a Changing World, Fifth Edition
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
Key Takeaway Points A use case is a business process; it begins with an actor, ends with the actor, and accomplishes a business task for the actor. Use.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Systems Analysis and Design in a Changing World, 3rd Edition
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
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.
© 2005 Prentice Hall9-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Object Oriented Software Engineering Chapter 16 and 17 review 2014/06/03.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Introduction to Object Modeling
ECE450S – Software Engineering II
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Geospatial Systems Design and UML Or Looking at “OMT-G: An Object-Oriented Data Model for Geographic Applications” by Karla A.V. Borges, Clodoveu A. Davis.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition.
Systems Analysis and Design in a Changing World, Fourth Edition
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
Chapter 3: Introducing the UML
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 17 Object-Oriented Design and Modeling Using the UML.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
UML Diagrams By Daniel Damaris Novarianto S..
Chapter 5:Design Patterns
Design Patterns Lecture part 2.
Introduction to Design Patterns
Unified Modeling Language
UML Diagrams Jung Woo.
CIS 375 Bruce R. Maxim UM-Dearborn
Analysis models and design models
Chapter 22 Object-Oriented Systems Analysis and Design and UML
CIS 375 Bruce R. Maxim UM-Dearborn
Presentation transcript:

McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 18 Object-Oriented Design and Modeling Using the UML

18-2 Object-Oriented Design Object-oriented design (OOD) – an approach used to specify the software solution in terms of collaborating objects, their attributes, and their methods. Continuation of object-oriented analysis

18-3 Design Classes In OO programming every piece of code resides inside an object class

18-4 Types of Design Classes Entity Class - contains business related information and implements analysis classes. Interface Class - provides the means by which an actor interacts with the system. A window, dialogue box, or screen. For nonhuman actors, an application program interface (API). Control Class - contains application logic. Persistence Class - provides functionality to read and write to a database. System Class - handles operating system- specific functionality.

18-5 Design Relationships - Dependency A dependency relationship is used to model the association between two classes: To indicate that when a change occurs in one class, it may affect the other class. To indicate the association between a persistent class and a transient class. Interface classes typically are transient Illustrated with a dashed arrow

18-6 Design Relationships - Navigability Classes with associations can navigate (send messages) to each other. By default the associations are bidirectional. Sometimes you want to limit the message sending to only one direction. Illustrated with an arrow pointing in the direction a message can be sent.

18-7 Attribute and Method Visibility Visibility – the level of access an external object has to an attribute or method. Public attributes/methods can be accessed/invoked by any other method in any other object or class. Denoted by the + symbol Protected attributes/methods can be accessed/ invoked by any method in the same class or in subclasses of that class. Denoted by the # symbol Private attributes/methods can be accessed/invoked by any method in the same class. Denoted by the – symbol Method – the software logic that is executed in response to a message.

18-8 Object Responsibilities Object responsibility – the obligation that an object has to provide a service when requested and thus collaborate with other objects to satisfy the request if required. An object responsibility is implemented by the creation of methods that may have to collaborate with other objects and methods.

18-9 Object Responsibility

18-10 The Process of Object-Oriented Design Refining the use case model to reflect the implementation environment. Modeling class interactions, behaviors, and states that support the use case scenario. Updating the class diagram to reflect the implementation environment.

18-11 Refining The Use Case Model Step 1: Transform the “Analysis” Use Cases to “Design” Use Cases Implementation details Controls Window/web page names Navigation instructions Step 2: Update the Use Case Model Diagram and Other Documentation to Reflect any New Use Cases

18-12 Design Use Case

18-13 Design Use Case (continued)

18-14 Design Use Case (continued)

18-15 Design Use Case (concluded)

18-16 Modeling Class Interactions, Behaviors, and States Step 1: Identify and Classify Use-Case Design Classes Step 2: Identify Class Attributes Step 3: Identify Class Behaviors and Responsibilities Step 4: Model Object States Step 5: Model Detailed Object Interactions

18-17 Step 1: Identify and Classify Use-Case Design Classes Interface, Control, and Entity Classes of Place New Order Use Case Interface ClassesController ClassesEntity Classes W00-Member Home Page W02-Member Profile Display W03-Display Order Summary W04-Display Order Confirmation W09-Member Account Status Display W11-Catalog Display W15-Product Detail Display Place New Order HandlerBilling Address Shipping Address Address Active Member Member Order Member Ordered Product Product Title Audio Title Game Title Video Title Transaction

18-18 Step 2: Identify Class Attributes Many attributes already identified during object-oriented analysis. Revised use cases may mention additional attributes. Must update class diagram to include new attributes.

18-19 Step 3: Identify Class Behaviors and Responsibilities Analyze use cases to identify required system behaviors Search for verb phrases Some will reflect manual actions, others automated Associate behaviors and responsibilities with classes Model classes that have complex behavior Examine class diagram for additional behaviors Verify classifications

18-20 Condensed Behavior List Condensed Behavior List for Place New Order Use Case BehaviorsClass Type Process new member orderControl Retrieve product catalog informationEntity Display W11-Catalog Display windowInterface Retrieve member demographic informationEntity Display W02-Member Profile Display windowInterface Validate quantity amountEntity Verify the product availabilityEntity Determine an expected ship dateEntity Determine cost of the total orderEntity Display W03-Order Summary Display windowInterface Prompt userInterface Check Status of member accountEntity...

18-21 Tools for Identifying Behaviors and Responsibilities Class Responsibility Collaboration (CRC) Card - a card that lists all behaviors and responsibilities assigned to a class. Often built interactively in a group setting that walks through a use case Sequence diagram - a UML diagram that models the logic of a use case by depicting the interaction of messages between objects in time sequence.

18-22 CRC Card Listing Behaviors and Collaborators of a Class Object Name: Member Order Sub Object: Super Object: Transaction Behaviors and ResponsibilitiesCollaborators Report order information Calculate subtotal cost Calculate total order cost Update order status Create Ordered Product Delete Ordered Product Member Ordered Product

18-23 Sequence Diagram 1.Actor 2.Interface class 3.Controller class 4.Entity classes 5.Messages 6.Activation bars 7.Return messages 8.Self-call 9.Frame

18-24 Another Sequence Diagram

18-25 Guidelines for Constructing Sequence Diagrams Identify the scope of the sequence diagram, whether entire use-case scenario or one step. Draw actor and interface class if scope includes that. List use-case steps down the left-hand side. Draw boxes for controller class and each entity class that must collaborate in the sequence (based on attributes or behaviors previously assigned). Add persistence and system classes if scope includes that. Draw messages and point each to class that will fulfill the responsibility. Add activation bars to indicate object instance lifetimes. Add return messages as needed for clarity. Add frames for loops, optional steps, alternate steps, etc.

18-26 Step 4: Model Object States Object state – a condition of the object at one point in its lifetime. State transition event –occurrence that triggers a change in an object’s state through updating of one or more of its attribute values. State machine diagram – a UML diagram that depicts: the combination of states that an object can assume during its lifetime, the events that trigger transitions between states, the rules governing the objects in transition.

18-27 Object State Example

18-28 State Machine Diagram

18-29 Updating Object Model to Reflect Implementation Environment Design class diagram – a diagram that depicts classes that correspond to software components that are used to build the software application. Includes: Classes Associations and gen/spec and aggregation relationships Attributes and attribute-type information Methods with parameters Navigability Dependencies

18-30 Transforming Analysis Class Diagram to Design Class Diagram Add design objects to diagram Add attributes and attribute-type information to design objects Add attribute visibility Add methods to design objects Add method visibility Add association navigability Add dependency relationships

18-31 Four Implicit Object Behaviors Create new instances Update data or attributes Delete instances Display information

18-32 Partial Design Class Diagram

18-33 Object Reusability Coupling - the degree to which one class is connected to or relies upon other classes. Cohesion - the degree to which the attributes and behaviors of a single class are related to each other. The two overarching goals of object-oriented design are low coupling and high cohesion. Allows for object reuse.

18-34 Design Patterns Design pattern - a common solution to a give problem in a given context, which supports reuse of proven approaches and techniques. Advantages Allow us to design with the experiences of those who came before rather than having to "reinvent the wheel." Provide designers a short-hand notation for discussing design issues.

18-35 Sample Design Pattern

18-36 Gang-of-Four Patterns Creational Abstract factor Builder Factory method Prototype Singleton Structural Adapter Bridge Composite Decorator Façade Proxy Behavioral Chain of responsibility Command Flyweight Interpreter Iterator Mediator Memento Observer State Strategy Template method Visitor

18-37 Strategy Pattern Pattern:Strategy Category:Behavioral Problem:How to design for varying and changing policy algorithms? Solution:Define each algorithm in a separate class with a common interface.

18-38 Adapter Pattern Pattern:Adapter Category:Structural Problem:How to provide a stable interface to similar classes with different interfaces? Solution:Add a class that acts as an adapter to convert the interface of a class into another interface that the client classes expect.

18-39 Frameworks and Components Object framework – a set of related, interacting objects that provide a well- defined set of services for accomplishing a task. Component – a group of objects packaged together into one unit. An example of a component is a dynamic link library (DLL) or executable file.

18-40 Additional UML Design and Implementation Diagrams Communication diagram - models the interaction of objects via messages, focusing on the structural organization of objects in a network format. Component diagram - depicts the organization of programming code divided into components and how the components interact. Deployment diagram - depicts the configuration of software components within the physical architecture of the systems hardware "nodes."

18-41 Communication Diagram 1.Class 2.Messages 3.Self-calls 4.Numbering scheme - messages should be numbered with a nested scheme.