Object-Oriented Design. From Analysis to Design Analysis Artifacts –Essential use cases What are the problem domain processes? –Conceptual Model What.

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Advertisements

Object Design Examples with GRASP
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Interaction Diagram Notation From Chapter 15 of Craig Larman, Applying UML and Patterns John Dalesandro.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Chapter 1 Object Oriented Analysis and Design. UML, Patterns, and Object-Oriented Analysis and Design  The essential skills for the creation of well-designed,
Object-Oriented Analysis and Design
Copyright W. Howden1 Lecture 7: Functional and OO Design Descriptions.
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.
OO Development Process. UML and Process UML standardizes notation, not process –Increase likelihood of widespread acceptance There is significant variability.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
6/8/991 Analysis Tuesday 09/14/99 Revised: September 11, 2000 (APM)
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
9/18/011 Software Requirements Analysis and Design (Continued)
Object-Oriented Analysis and Design
Object-Oriented Analysis and Design
Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative Development Part III Elaboration Iteration I – Basic1.
Chapter 7: The Object-Oriented Approach to Requirements
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
The Design Discipline.
Systems Analysis and Design in a Changing World, Fifth Edition
Object Oriented Analysis By: Don Villanueva CS 524 Software Engineering I Fall I 2007 – Sheldon X. Liang, Ph. D.
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Interaction diagrams Sequence and collaboration diagrams.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
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.
1 SAD2 - UML 4 th Lecture Class Diagram in Construction Phase Patterns Case Study Lecturer: Dr Dimitrios Makris
1 On to Object Design Chapter 14 Applying UML and Patterns.
Introduction To System Analysis and Design
Object-Oriented Analysis and Design An Introduction.
Object Design Examples with GRASP (Ch. 18)
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.
Design Patterns. Patterns “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Systems Analysis and Design in a Changing World, 3rd Edition
Copyright © Hsiao-Lan Wei All Rights Reserved Design Model Interaction diagram.
GRASP: Designing Objects with Responsibilities
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Design Class Diagrams (DCDs)
Chapter 16 Applying UML and Patterns Craig Larman
1 Class Diagrams: The Essentials. 2 Terms and Concepts A class is... The most important building block of any object-oriented system. A description of.
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
Lecture 6: Structural Modeling
Introduction To OOP 1.0 Fundamentals Of Java Programming Language 2.0 Exception Handling 3.0 Classes, Inheritance And Polymorphism © 2011 | PN AZRINA.
What to remember from Chap 13 (Logical architecture)
1 Capturing Requirements As Use Cases To be discussed –Artifacts created in the requirements workflow –Workers participating in the requirements workflow.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9.
Design Model Lecture p6 T120B pavasario sem.
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
TK2023 Object-Oriented Software Engineering CHAPTER 12 Introduction to Responsibility-Driven Design.
Domain Model A representation of real-world conceptual classes in a problem domain. The core of object-oriented analysis They are NOT software objects.
Chapter 16 UML Class Diagrams.
OO Methodology Elaboration Phase Iteration 1- Part 3.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
BTS430 Systems Analysis and Design using UML Design Class Diagrams (ref=chapter 16 of Applying UML and Patterns)
1 Kyung Hee University Interaction Diagrams Spring 2001.
Object Oriented Analysis & Design By Rashid Mahmood.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
1 Object Oriented Analysis and Design System Events & Contracts.
Chapter 16 UML Class Diagrams.
GRASP: Visibility and Design
Chapter 12: Collaboration Diagram - PART2
Chapter 11: Collaboration Diagram - PART1
Requirements To Design In This Iteration
Analysis models and design models
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Design Model: Creating Design Class Diagrams
Presentation transcript:

Object-Oriented Design

From Analysis to Design Analysis Artifacts –Essential use cases What are the problem domain processes? –Conceptual Model What are the concepts and terms? –System sequence diagrams What are the system events and operations? –Contracts What do the system operations do?

Design Process 1. Define real use cases including user interface and reports. –Details may be left for implementation 2. Define interaction diagrams. 3. Refine design class diagrams. 4. Refine system architecture. 5. Define database schema.

Interaction Diagrams Illustrate how objects interact via messages to accomplish tasks. Show how responsibility for a task is distributed over a group of objects. Two kinds of UML interaction diagrams: –Sequence diagrams –Collaboration diagrams

Responsibility Assignment The amount of time spent on responsibility assignment and generation of interaction diagrams should absorb a significant percentage of the overall project effort. This step requires more design skill than any other. Application of patterns, idioms, and principles can be applied to improve the quality of the design.

CRC Cards Class-Responsibility-Collaborator Cards Not part of UML One index card for each class listing responsibilities and collaborators Developed in small groups where people role play various classes. Group design efforts with responsibility assignment and role playing are effective with or without CRC cards.

Collaboration Diagram Process 1. Create a separate diagram for each system operation under development in current cycle. 2. If the diagram gets too complex, split it into smaller diagrams. 3. Starting from use case descriptions and contracts design a system of interacting objects to fulfill the tasks.

Basic Notation Sales1:Sale:Sale classinstance named instance :Sale:POST 1: addPayment(amount: Money) link message

Messages :POST 1: clear( ) Message to “self” :POST 1: tot := total():Integer :Sale Return value :POST 1: create(cashier) «new» :Sale Instance creation

Collections and Iteration :POST 1*: li := nextLineItem( ) :Sale :POST 1: n := size( ) 2*: [i := 1..n] s := get(i ) :Sale 3*: [i := 1..n] total( ) s {local} :Sale

Message Sequence Numbering The first message (usually corresponding to an external event) is not numbered. Messages are numbered to indicate the order in which they are sent. –May be a simple numbering –May use complex sequence numbering to show nesting of messages

Complex sequence numbering :POST 1: n := size( ) 2*: [i := 1..n] s := get(i ) :Sale 3*: [i := 1..n] total( ) s {local} :LineItem 3.l*: [for each] li := next( ) 3.2*: [for each] subtotal( ) li {local} totalSales( ) :LineItem :Sale

Conditionals :classA:classB :classC:classD :classE msg1 ( ) 2: msg6 ( ) 1a: [test] msg2 ( ) 1b.1: msg5 ( ) 1a.1: msg4 ( ) 1b: [not test] msg3 ( )

Messages to classes :Sale 1: d := today ( ): Date Date

Refining Class Diagrams Depends on: –Existing design class diagram (in first development cycle, will be a copy of the conceptual class diagram). –Interaction diagrams from which the software classes, methods, and associations that participate in the solution are identified. Developed in parallel with interaction diagrams.

Design class diagrams Classes, associations, and attributes Interfaces with operations and constants Methods Attribute type information Navigability Dependencies

Refinement Process 1. Analyze the interaction diagrams to identify participating classes. 2. Add methods, attributes, and associations required to support the interactions. 3. Add type information to attributes and methods. 4. Add navigability arrows to show attribute visibility. 5. Add dependency relationship lines.

Methods create messages may be omitted or mapped to constructor methods in the implementation language. Accessor methods (get, set) may be omitted from diagrams. Messages to collections imply methods in the collection class itself (e.g. Vector, HashTable), not the class of objects in the collection.

Associations Based on software-oriented need-to-know criterion – what associations are required in order to support the interactions. Unlike conceptual model where associations may be justified by enhancement of problem domain comprehension. Like conceptual model, associations show relatively static structural relationships, not transient events.

Navigability Arrows on associations indicate navigability from the source to target class. Navigability from class A to B usually implies an attribute in A objects containing a reference to a B object. Design class diagrams should contain the appropriate navigability arrows.

Example: POS POST +endSale() +enterItem(ups: integer, qty: integer) +makePayment(amount: Money) Sale +becomeComplete() +total(): Money +makePayment(amount: Money) date: Date time: Time isComplete: Boolean 1 *

Associations and Dependencies Associations are static structural relationships that are visible via attributes. A dependency relationship indicates that one class has non-attribute knowledge of another. Dependencies arise through parameters, local variables, and global variables. Dependencies are illustrated by dashed arrows on design class diagrams.

Key Points Interaction diagrams show how responsibility for a task is distributed over a group of objects. Compared to sequence diagrams, collaboration diagrams: –Offer exceptional expressiveness, ability to convey contextual information and relative spatial economy. –Also, more complexity.

Key Points (2) Responsibility assignment requires significant time and skill. Design class diagrams include more information than conceptual diagrams: – Methods, type information, navigability, dependencies Designs are based on software-oriented need-to- know criteria rather than problem domain criteria.