Chapter 22 Object-Oriented Design

Slides:



Advertisements
Similar presentations
Software Engineering Key design concepts Design heuristics Design practices.
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
JDBC Session 4 Tonight: Design Patterns 1.Introduction To Design Patterns 2.The Factory Pattern 3.The Facade Pattern Thursday & Next Tuesday: Data Access.
Design Phase What’s design?
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
© 2005 Prentice Hall6-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
The Bridge Pattern.. Intent Decouple an abstraction from its implementation so that the two can vary independently Also known as: Handle/Body.
Component-Level Design
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Object Oriented System Development with VB .NET
Design Patterns Based on Design Patterns. Elements of Reusable Object-Oriented Software. by E.Gamma, R. Helm, R. Johnson,J. Vlissides.
Chapter 8 Object Design Reuse and Patterns. Finding Objects The hardest problems in object-oriented system development are: –Identifying objects –Decomposing.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Design Patterns Ric Holt & Sarah Nadi U Waterloo, March 2010.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Creational Patterns Making Objects The Smart Way Brent Ramerth Abstract Factory, Builder.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The Façade Design Pattern (1) –A structural design pattern.
Chapter 10 Architectural Design
Object Oriented Analysis & Design
Why Analysis Process Refer to earlier chapters Models what the system will do makes it easier for understanding no environment considered (hence, system.
1 Object-Oriented Testing CIS 375 Bruce R. Maxim UM-Dearborn.
Design Patterns.
Chapter 5CSA 217 Design in Construction Chapter 5 1.
CSE 303 – Software Design and Architecture
Case Studies on Design Patterns Design Refinements Examples.
CS 325: Software Engineering March 17, 2015 Applying Patterns (Part A) The Façade Pattern The Adapter Pattern Interfaces & Implementations The Strategy.
CS 350 – Software Design An Introduction to Design Patterns – Chapter 5 A proposition behind design patterns is that quality of software systems can be.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
SOFTWARE DESIGN.
Object Oriented Analysis & Design Software Engineering Lab. Sharif University of Technology.
Drexel University CS 451 Software Engineering Winter Yuanfang Cai Room 104, University Crossings
Systems Analysis and Design in a Changing World, 3rd Edition
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 11 Slide 1 Design.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 05. Review Software design methods Design Paradigms Typical Design Trade-offs.
GRASP: Designing Objects with Responsibilities
L11-12: Design Patterns Definition Iterator (L4: Inheritance)‏ Factory (L4: Inheritance)‏ Strategy (L5: Multiple Inheritance)‏ Composite (L6: Implementation.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
ECE450S – Software Engineering II
ARCHITECTURAL DESIGN. Why is Architecture Important? Representations of software architecture are an enabler for communication between all parties (stakeholders)
CS 8532: Advanced Software Engineering Dr. Hisham Haddad Overview of Object-Oriented Design Highlights of OOD Concepts, Components, and Process.
1 CMPT 275 High Level Design Phase Modularization.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 system architecture 1 after designing to meet functional requirements, design the system.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Dr D. Greer, Queens University Belfast )Chapter Six 1 Software Engineering Chapter Six Software Design Quality Learning Outcomes.
Software Engineering OO Design. Objectives 1.Describe the Object Oriented design process 2.Detail the UML models produced during OO design.
More Design Patterns From: Shalloway & Trott, Design Patterns Explained, 2 nd ed.
1 Chapter 5:Design Patterns. 2 What are design pattern?  Schematic description of design solution to recurring problems in software design and,  Reusable.
1 Software Design Lecture What’s Design It’s a representation of something that is to be built. i.e. design  implementation.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Watching the movie the hard way…. Page 256 – Head First Design Patterns.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
CSIS 4850: CS Senior Project – Spring 2009 CSIS 4850: Senior Project Spring 2009 Object-Oriented Design.
OBJECT-ORIENTED TESTING. TESTING OOA AND OOD MODELS Analysis and design models cannot be tested in the conventional sense. However, formal technical reviews.
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
Design Patterns: MORE Examples
Chapter 5:Design Patterns
Object Oriented Analysis & Design
Design Pattern: Facade
For University Use Only
TIM 58 Chapter 8: Class and Method Design
CIS 375 Bruce R. Maxim UM-Dearborn
Object-Oriented Design
Chapter 22 Object-Oriented Design
CS 350 – Software Design An Introduction to Design Patterns – Chapter 5 A proposition behind design patterns is that quality of software systems can be.
Structural Patterns: Adapter and Bridge
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

Chapter 22 Object-Oriented Design

Object-Oriented Design

OOA and OOD

OOA and OOD

Design Issues decomposability—the facility with which a design method helps the designer to decompose a large problem into subproblems that are easier to solve; composability—the degree to which a design method ensures that program components (modules), once designed and built, can be reused to create other systems; understandability—the ease with which a program component can be understood without reference to other information or other modules; continuity—the ability to make small changes in a program and have these changes manifest themselves with corresponding changes in just one or a very few modules; protection—a architectural characteristic that will reduce the propagation of side affects if an error does occur in a given module.

Generic Components for OOD Problem domain component—the subsystems that are responsible for implementing customer requirements directly; Human interaction component —the subsystems that implement the user interface (this included reusable GUI subsystems); Task Management Component—the subsystems that are responsible for controlling and coordinating concurrent tasks that may be packaged within a subsystem or among different subsystems; Data management component—the subsystem that is responsible for the storage and retrieval of objects.

Process Flow for OOD

System Design Process • Partition the analysis model into subsystems. • Identify concurrency that is dictated by the problem. • Allocate subsystems to processors and tasks. • Develop a design for the user interface. • Choose a basic strategy for implementing data management. • Identify global resources and the control mechanisms required to access them. • Design an appropriate control mechanism for the system, including task management. • Consider how boundary conditions should be handled. • Review and consider trade-offs.

System Design

Subsystem Example

Subsystem Design Criteria • The subsystem should have a well-defined interface through which all communication with the rest of the system occurs. • With the exception of a small number of “communication classes,” the classes within a subsystem should collaborate only with other classes within the subsystem. • The number of subsystems should be kept small. • A subsystem can be partitioned internally to help reduce complexity.

Subsystem Collaboration Table

Object Design A protocol description establishes the interface of an object by defining each message that the object can receive and the related operation that the object performs An implementation description shows implementation details for each operation implied by a message that is passed to an object. information about the object's private part internal details about the data structures that describe the object’s attributes procedural details that describe operations

Design Patterns ... you’ll find recurring patterns of classes and communicating objects in many object-oriented systems. These patterns solve specific design problems and make object-oriented design more flexible, elegant, and ultimately reusable. They help designers reuse successful designs by basing new designs on prior experience. A designer who is familiar with such patterns can apply them immediately to design problems without having to rediscover them. Gamma and his colleagues [GAM95]

Design Pattern Attributes The design pattern name is an abstraction that conveys significant meaning about it applicability and intent. The problem description indicates the environment and conditions that must exist to make the design pattern applicable. The pattern characteristics indicate the attributes of the design that may be adjusted to enable the pattern to accommodate into a variety of problems. The consequences associated with the use of a design pattern provide an indication of the ramifications of design decisions.

Example Miter joint – Dovetail joint in window Miter Dovetail Simpler lightweight inconspicuous Dovetail More complex, impervious temperature and humidity Independent of fastening system Beautiful when made well

Facade Pattern Name - Facade Problem Solution You need to use only a subset of a complex system. Or you need to interact with the system in a particular way. Solution Define a new class (or classes) That has the required interface Have this new class use the existing system. Facade picture p. 89

Façade (cont.) Trade-offs The facade simplifies the use of the required subsystem. However, since the facade is not complete, certain functionality may be unavailable to the client

Facade Subsystem Facade

Summary – Applies when You do not need to use all the functionality of a complex system You want to encapsulate or hide the original system You want to use the functionality of the original system and want to add some new functionality as well The cost of writing this new class is less than the cost of everybody learning how to use the original system or is less than you would spend on maintenance in the future

Adapter Name – Adaptor (wrapper) Problem A system has the right data and behavior but the wrong interface. Often used when you have to make something a derivative of an abstract class we are defining or already have Motivation Shape hierarchy Implementation of xx circle but doesn’t inherit from shape

Solution Provide a wrapper with the desired interface Object adapter – Adapter contains the adaptee (pointer?) Use inline functions to forward Class adapter Use multiple inheritance – private

Adaptor Target Adaptee Client Adaptor

Trade offs Efficiency issues Writing function forwarding Note Facade often hides several classes but may be 1 Adapter often hides 1 but may be several

Find what varies and encapsulate it Abstract class Core – defines commonality Commonality Which abstract classes to use Variations Derivations of abstract classes Specification Interface of classes

Abstract class Core concept - commonality Variations are derivation of an abstract class

Specification, Interface, Implementation Specification – conceptual, identifies interface Specification implementation - given specification how can I implement this particular variation

Bridge Pattern Name - bridge Problem the derivations of an abstract class must use multiple implementations without causing an explosion in the number of classes

Solution Define an interface for all implementations to use and have the derivations of the abstract class use that.

Bridge Pattern Abstraction Implementor Concrete Concrete Implementor B Concrete Implementor A Refined Abstraction

Tradeoffs The decoupling of the implementation from the objects that use them increases extensibility. Client objects are not aware of implementation issues. Variations of shape are encapsulated in shape class Variations in drawing are encapsulated in drawing class

Abstract Factory Name: Abstract Factory Problem: Families of related objects need to be instantiated. Solution: The abstract factory defines the interface for how to create each member of the family. Each family is created by having its own unique concrete factory.

Tradeoffs Isolates concrete classes Makes exchanging product families easy Promotes consistency among products Hard to add new kinds of products

Abstract Factory Client Abstract Product B Abstract Product A Abstract

Summary First, identify the rules for instantiation and define an abstract class with an interface that has a method for each object that needs to be instantiated Implement concrete classes from this class for each family The client object uses this factory object to create the server objects that it needs