Object-Oriented Design and Modeling Using the UML

Similar documents
Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

Input Design and Prototyping

Process Modeling. Wei-Tsong Wang 1 IIM, NCKU

CS504-Softwere Engineering -1 Solved Objective Midterm Papers For Preparation of Midterm Exam

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis

Chapter 10 Object-Oriented Design Principles

Chapter 5: Structural Modeling

Chapter : Analysis Modeling

06. Analysis Modeling

Chapter 2: The Object-Oriented Design Process

Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

Objectives. Explain the purpose and objectives of objectoriented. Develop design class diagrams

Meltem Özturan

Introduction to UML. Danang Wahyu utomo

Requirements Modeling (Ch. 6)

Unified Modeling Language (UML) and Modeling

Architecture and the UML

Unified Modeling Language (UML) Class Diagram

Object-Oriented Design

Assigning Responsibilities (Patterns of Responsibility Assignment Principles: GRASP)

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Software Life-Cycle Models

Object-Oriented Systems Analysis and Design Using UML

Unified Modeling Language (UML)

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

SHRI ANGALAMMAN COLLEGE OF ENGINEERING & TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR,TRICHY

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Patterns and Testing

Chapter 1: Principles of Programming and Software Engineering

Solved Question Paper June 2017

17. GRASP: Designing Objects with Responsibilities

Object Orientated Analysis and Design. Benjamin Kenwright

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Software Service Engineering

CASE TOOLS LAB VIVA QUESTION

CS485/540 Software Engineering Requirements Modeling (Ch. 6)

UML UNIFIED MODELLING LANGUAGE EXEMPLIFIED ON BLACKJACK. Object Oriented Programming (Samy Zafrany)

SE 1: Software Requirements Specification and Analysis

Object-Oriented Design

Unified Modeling Language (UML)

Rekayasa Perangkat Lunak 2 (IN043): Pertemuan 6. Moving on to Design

CS 370 REVIEW: UML Diagrams D R. M I C H A E L J. R E A L E F A L L

Progress Report. Object-Oriented Software Development: Requirements elicitation (ch. 4) and analysis (ch. 5) Object-oriented software development

7. UML Sequence Diagrams Page 1 of 1

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

12 Tutorial on UML. TIMe TIMe Electronic Textbook

CS211 Lecture: Modeling Dynamic Behaviors of Systems; Interaction Diagrams in UML

Analysis and Design with UML

INTERNAL ASSESSMENT TEST III Answer Schema

Ch 11 Software Development

MCQS for Midterm cs504 Combined by Anees Ahmad

Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts. Object-Oriented Design CRC Cards - UML class diagrams

Computer Science for Engineers

IS 0020 Program Design and Software Tools

Design Concepts. Slide Set to accompany. Software Engineering: A Practitioner s Approach, 7/e by Roger S. Pressman

UML REFERENCE SHEETS. 2013, 2014 Michael Marking; all rights reserved, including moral rights. Web site:

1. Introduction to Object Oriented Software Development

THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9)

Object-Oriented Analysis and Design Using UML (OO-226)

GRASP: Patterns for. chapter18

CHAPTER 9 DESIGN ENGINEERING. Overview

Basic Structural Modeling. Copyright Joey Paquet,

UML diagrams. Software artifacts include: SRS, SDS, test cases, source code, technical/user manual, software architecture, etc.

Object-oriented development. Object-oriented Design. Objectives. Characteristics of OOD. Interacting objects. Topics covered

Object-Oriented Design

Introduction to Software Engineering. ECSE-321 Unit 9 Architectural Design Approaches

Introduction to Software Engineering

Interaction Modelling: Sequence Diagrams

Responsibilities. Using several specific design principles to guide OO design decisions.

7. Object-Oriented Design

A Rapid Overview of UML

Unified Modeling Language (UML)

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD TM : ,

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

UML Views of a System

Software Engineering - I

Progress Report. Object-Oriented Software Development: Requirements elicitation and analysis. Object-oriented analysis, design, implementation

Object-Oriented and Classical Software Engineering

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING CS2353-OBJECT ORIENTED ANALYSIS AND DESIGN. Unit-I. Introduction to OOAD

Use-Case Analysis. Architecture Oriented Analysis. R. Kuehl/J. Scott Hawker p. 1 R I T. Software Engineering

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Information Technology Audit & Cyber Security

Software Design And Modeling BE 2015 (w. e. f Academic Year )

OBJECT ORIENTED ANALYSIS AND DESIGN SYLLABUS

Pieter van den Hombergh. Fontys Hogeschool voor Techniek en Logistiek. September 9, 2016

Appendix A - Glossary(of OO software term s)

Component-Level Design. Slides copyright 1996, 2001, 2005, 2009 by Roger S. Pressman. For non-profit educational use only

Ans 1-j)True, these diagrams show a set of classes, interfaces and collaborations and their relationships.

Standard User Site Registration Account Options Customer Hot List Creation & Utilization.

The Unified Modeling Language. Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL

Äriprotsesside modelleerimine ja automatiseerimine Loeng 7 Valdkonna mudel

UML Is Not a Methodology

OOAD - OBJECT MODEL. The concepts of objects and classes are intrinsically linked with each other and form the foundation of object oriented paradigm.

CS211 Lecture: Modeling Dynamic Behaviors of Systems; Interaction Diagrams and Statecharts Diagrams in UML

COSC 3351 Software Design. An Introduction to UML (I)

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

LABORATORY 1 REVISION

Transcription:

Design Classes Object-Oriented Design and Modeling Using the UML Based on Chapter 18 of Whitten, Bentley, and Dittman: Systems Analysis and Design for the Global Enterprise (7th Ed). McGraw Hill. 2007 In OO programming every piece of code resides inside an object class Wei-Tsong Wang 1 IIM, NCKU 3 Object-Oriented Design Types of Design Classes 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 (Ch. 10) 2 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 (e.g. business rules). Persistence Class - provides functionality to read and write to a database. System Class - handles operating system-specific functionality. 4

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 5 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. 7 Design Relationships - Navigability Object Responsibilities 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. 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. 6 8

Object Responsibility 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 9 11 The Process of Object-Oriented Design Design Use Case 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. 10 12

Design Use Case (continued) Design Use Case (concluded) 13 15 Design Use Case (continued) 14 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 16

Step 1: Identify and Classify Use- Case Design Classes Interface, Control, and Classes of Place New Order Use Case Interface 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 Controller Classes Place New Order Handler Classes Billing Address Shipping Address Email Address Active Member Member Order Member Ordered Product Product Title Audio Title Game Title Video Title 17 Transaction 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 19 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 Condensed Behavior List Condensed Behavior List for Place New Order Use Case Behaviors Class Type Process new member order Control Retrieve product catalog information Display W11-Catalog Display window Interface Retrieve member demographic information Display W02-Member Profile Display window Interface Validate quantity amount Verify the product availability Determine an expected ship date Determine cost of the total order Display W03-Order Summary Display window Interface Prompt user Interface Check Status of member account... 20

Tools for Identifying Behaviors and Responsibilities Sequence Diagram Class Responsibility Collaboration (CRC) Card - a card that lists all behaviors and responsibilities assigned to a class. Often built interactively in a group setting (system analysts and/or users) 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. 21 1. Actor 2. Interface class 3. Controller class 4. classes 5. Messages 6. Activation bars 7. Return messages 8. Self-call 9. Frame 23 CRC Card Listing Behaviors and Collaborators of a Class Another Sequence Diagram Object Name: Member Order Sub Object: Super Object: Transaction Behaviors and Responsibilities Report order information Calculate subtotal cost Calculate total order cost Update order status Create Ordered Product Delete Ordered Product Collaborators Member Ordered Product 22 24

Step 4: Model Object States State Machine Diagram 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. 25 27 Object State Example Verifying Object Behavior and Collaboration Role playing the act of simulating object behavior and collaboration by acting out an object s behaviors and responsibilities. Participants may assume the role of an actor on an object type Message sending is simulated by using an item such as a ball that is passed between the participants. Useful for discovering missing objects and behaviors. 26 28

Updating Object Model to Reflect Implementation Environment Partial Design Class Diagram 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 29 31 Transforming Analysis Class Diagram to Design Class Diagram Object Reusability 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 30 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. 32

Design Patterns Strategy Pattern 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. Pattern: Category: Problem: Solution: Strategy Behavioral How to design for varying and changing policy algorithms? Define each algorithm in a separate class with a common interface. 33 35 Sample Design Pattern Adapter Pattern Pattern: Category: Problem: Solution: Adapter Structural How to provide a stable interface to similar classes with different interfaces? Add a class that acts as an adapter to convert the interface of a class into another interface that the client classes expect. 34 36

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. 37