1 © 2007 T. Horton CS 441, Summer 2007 Principles of SW Design Design Patterns in Context – Doing design: can we say more about how to go about it? Readings:

Slides:



Advertisements
Similar presentations
Week 2 The Object-Oriented Approach to Requirements
Advertisements

Object-Oriented Software Engineering Visual OO Analysis and Design
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Introduction To System Analysis and Design
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.
The Unified Software Development Process - Workflows Ivar Jacobson, Grady Booch, James Rumbaugh Addison Wesley, 1999.
1 Objectives To introduces the concept of software Design. To introduce the concept of Object- Oriented Design (OOD). To Define various aspects about object.
Software Engineering I Object-Oriented Design
© Copyright Eliyahu Brutman Programming Techniques Course.
Use Case Analysis – continued
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Object-Oriented Analysis and Design
Chapter 7: The Object-Oriented Approach to Requirements
Introduction To System Analysis and design
CS 8532: Adv. Software Eng. – Spring 2007 Dr. Hisham Haddad Tuesday Class will start momentarily. Please Stand By … CS 8532: Advanced Software.
© Drexel University Software Engineering Research Group (SERG) 1 Based on the paper by Philippe Kruchten from Rational Software.
Systems Analysis and Design in a Changing World, Fifth Edition
An Introduction to Software Architecture
CS 3610: Software Engineering – Spring 2009 Dr. Hisham Haddad – CSIS Dept. Class Project OO Design Document Here is what you need to do for your class.
4/10/05G-1 © 2001 T. Horton CS 494, Spring 2005 Object-Oriented Design & Dev. On to Design.
12 Systems Analysis and Design in a Changing World, Fifth Edition.
4/2/03I-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Software Architecture and Design Readings: Ambler, Chap. 7 (Sections to start.
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.
High-Level Design With Sequence Diagrams COMP314 (based on original slides by Mark Hall)
Requirement Engineering. Review of Last Lecture Problems with requirement Requirement Engineering –Inception (Set of Questions) –Elicitation (Collaborative.
Introduction To System Analysis and Design
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
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
Object-Oriented Analysis and Design Fall 2009.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 11 Slide 1 Design.
GRASP: Designing Objects with Responsibilities
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
CS 4850: Senior Project Fall 2014 Object-Oriented Design.
Chapter Five–Part I Object Oriented Design
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
CS 8532: Advanced Software Engineering Dr. Hisham Haddad Overview of Object-Oriented Design Highlights of OOD Concepts, Components, and Process.
Part VII: Design Continuous
1 CMPT 275 High Level Design Phase Modularization.
CS251 – Software Engineering Lecture 9: Software Design Slides by Mohammad El-Ramly, PhD
Software Design: Principles, Process, and Concepts Getting Started with Design.
CS2110: SW Development Methods Inheritance in OO and in Java Part 2: Topics: Forms of inheritance Interfaces in Java.
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
1 Software Design Lecture What’s Design It’s a representation of something that is to be built. i.e. design  implementation.
Exam 2 Review Software Engineering CS 561. Outline Requirements Development UML Class Diagrams Design Patterns Users, Usability, and User Interfaces Software.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
CSIS 4850: CS Senior Project – Spring 2009 CSIS 4850: Senior Project Spring 2009 Object-Oriented Design.
Project Deliverables CIS 4328 – Senior Project 2 And CEN Engineering of Software 2.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
High Level Design Use Case Textual Analysis SE-2030 Dr. Mark L. Hornick 1.
CHAP-1 OBJECT ORIENTED SYSTEM DESIGN (IT-703)
GRASP – Designing Objects with Responsibilities
Object-Oriented Analysis and Design
The Object Oriented Approach to Design
Object-Oriented Design
CS 494 Object-Oriented Analysis & Design
What is an Architecture?
Object oriented analysis and design
An Introduction to Software Architecture
واسط كاربري هوشمند Intelligent User Interface
CS 8532: Advanced Software Engineering
What is an Architecture?
Use Case Analysis – continued
Presentation transcript:

1 © 2007 T. Horton CS 441, Summer 2007 Principles of SW Design Design Patterns in Context – Doing design: can we say more about how to go about it? Readings: – Chap. 12 – Handout from Ambler’s book

2 Reminder: Design from Requirements Design activities start with… User-requirement descriptions –Customer-oriented –Task descriptions, XP “stories” –Use-cases, scenarios Requirement models –Conceptual models: UML class, sequence, state diagrams

3 Reminder: Goals for design Create detailed “plans” (like blueprints) for implementation Build these from requirements models so we are confident that all user needs will be met Create design models before coding so that we can: –Compare different possible design solutions –Evaluate efficiency, ease of modification, maintainability, etc

4 Design Goals Qualities Of A Good Design: –Correct, Complete, Changeable, Efficient, Simple Correctness: –It Should Lead To A Correct Implementation Completeness: –It Should Do Everything. Everything? It should follow the specifications. Changeable: –It Should Facilitate Change—Change Is Inevitable

5 Design Goals (cont’d) Efficiency –It Should Not Waste Resources. But: –Better A Working Slow Design Than A Fast Design That Does Not Work Simplicity –It Should Be As Understandable As Possible Important: A design should fully describe how coders will implement the system in the next phase –Designs are blue-prints for code construction

6 UML Notations for Design Several UML notations provide various views of a design Class diagrams: Possibly created at two different levels of abstraction for design: –Specification level: Classes model types, and we focus solely on interfaces between software modules –Implementation level: Think of this as a true “software blueprint”. We can go directly to code from this model. Two types of Interaction Diagrams: –Sequence diagrams and Collaboration diagrams

7 UML Notations for Design (2) Sequence diagrams –Objects will be variables implemented in code –Messages are operations applied to objects –Sequence diagrams thus show how a sequence of operations called between a set of objects accomplishes a larger task –Sequence diagrams for a particular scenario help identify operations needed in classes –They also allow us to verify that a design can support requirements (e.g. a use-case scenario)

8 UML Notations for Design (3) State diagrams (not covered, easy to learn) –Models how a particular object responds to messages according to its state –For a single object, show states and transitions between states –Transitions may be conditional based on a guard condition –May show an action an object takes on transition, or also activity carried out within a state –Occasionally used to model a system’s or subsystem’s behavior (not just one object’s)

9 UML Notations for Design (4) Packages –A simple notation that groups classes together –Possible to use this to show contents of a subsystem Show dependencies between packages Show visibility of classes between packages –Not really a rich enough notation for diagramming software architectures Other relationships beyond dependencies? No. Component Diagrams –Models physical modules of code (e.g. files, DLLs, physical databases)

10 Design Process There are many different approaches to design, but here is something typical. First, create a model of the high-level system architecture –UML does not really provide a notation this Next, use the conceptual class model to build a design-level class model or models –Here we’ll assume we’re just building an implementation-level class model Also, model dynamic behavior using interaction diagrams.

11 Design Process (cont’d) We’ll use sequence diagrams with objects from the implementation-level class model –Sequence diagrams show how design-level objects will carry out actions to implement scenarios defined as part of use-case analysis

12 Design Process (cont’d) Important: Development of class and sequence diagrams is iterative and concurrent When we create sequence diagrams for a new scenarios, we discover classes and operations that need to be added to the class model The two models grow together. Neither is a complete view of the system. Other documentation in text form is often used to provide details about class diagrams and sequence diagrams

13 Specification-Level Class Diagrams How does a design-level class diagram differ from a conceptual-level diagram? –No longer just an external view! –We are now modeling “how” not just “what”. This class diagram must document: –Additional classes –How you will implement associations Multiplicity, Navigability or Direction; Association classes

14 Additional Classes in a Design Are additional classes needed beyond what you see in conceptual class models? Of course! In general... Design-level “internal” classes –Data manager classes. E.g. collection objects that were simply associations before –Classes to implement design patterns –Facilitator or helper classes that assist with complex tasks –Factory classes that assist in creating new objects Is there any guidance or strategy for determining these?

15 Strategies Is there any guidance or strategy for determining these? Sure, but no standard way… Pattern-oriented approach –See Chap. 12 of our textbook Architecture-oriented approach –See slides coming up Agile Approach or XP (build/refactor) Others? –What works for you (or your boss)

16 Thinking in Patterns (a la Ch. 12) Important points –We often think of design as synthesis Putting together components, bottom up –Problems: Won’t get us elegance Parts are (de)refined in the context of the whole

17 Thinking in Patterns (a la Ch. 12) So instead –Begin with conceptual understanding of the whole system (requirements, overall structure of solution) –Identify patterns (from the problem space) –See if this helps create a context for the rest of the design (including other patterns) –Work towards specific design patterns and other specification-level design components –Refine and build

18 Architectures

19 Class Types in a Layered Architecture From Ambler, Sect layer model Classes only interact within layers, or as shown by arrows –Direction matters! Next slide describes these

20 Possible Design Class Types UI classes Business/Domain classes –Implement domain-objects from Analysis –Data objects plus their behaviors Controller/Process classes –implement business logic, collaborations between business objects and/or other controller Persistence classes –How to store, retrieve, delete objects –Hides underlying data stores from rest of system System classes –Wrap OS-specific functionality in case that changes

21 Controller/Process Layer Implements business logic –Encapsulate a business rule (see next slide) –These often require interactions etc. between objects of different classes Example from a student course enrollment system: When can a Student enroll in a Seminar? –Depends on schedule, pre-requisites, other constraints

22 Business Rules Back to requirements engineering: What kinds of requirements do we define? –Functional: the system must do X –Domain objects: the system must manipulate things with these characteristics and relationships –Also: policies Business rule: a policy your SW must satisfy –What a functional requirement “knows” about controls, guidelines, access control, restrictions, etc. –Often likely to change!

23 More on Controllers Why not just put business logic into the Domain class? –Business rules change. We want domain classes to be reusable. –In UI class? Then must use that UI to carry out this process. (Too tightly coupled.) How to find Controller classes? –To start: consider one for each use-case –If trivial or belongs in domain class, don’t.

24 Ambler’s Controller Class Example Example in Ambler, page 259 –Class: EnrollInSeminar (what’s interesting about that name?) Has link to a Student object An instance given to SeminarSelector object (UI), which calls seminarSelected(seminar) on it It tests if Student/Seminar combination is OK An instance given to FeeDisplay object (UI), which makes sure user willing to pay If so, its verifyEnrollment() is called to finalize enrollment

25 Controller Classes: Good OO? Violates a principle of the OO approach! –Data and behavior kept together! Yes, but is this always the best solution? –DVDs and DVD players -- why not one unit? –Cameras and film vs. disposable cameras Consider coupling, change, flexibility… Controller classes are an example of the Mediator design pattern Mediator or control classes might grow to become god classes –too much control, or too centralized

26 Summary of How this Approach Might be Done Work from an architecture model –Even an informal one Design domain classes Create a persistence layer between run-time objects and how they’re stored Identify system objects Use use-cases (requirements) to add control objects to work with UI and domain classes to implement functionality