SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

Object-Oriented Analysis and Design CHAPTER 17, 25: GRASP PATTERNS 1.
Object-Oriented Analysis and Design CHAPTERS 12-14: INTRODUCTION TO DESIGN 1.
GRASP Patterns M Taimoor Khan
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Oct 2, Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m Function:
Feb R. McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m Function:
Chapter 25 GRASP: More Objects with Responsibilities 1CS6359 Fall 2011 John Cole.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
NJIT More GRASP Patterns Chapter 22 Applying UML and Patterns Craig Larman Prepared By: Krishnendu Banerjee.
Object-Oriented Analysis and Design
GRASP : Designing Objects with Responsibilities
October 20, 2005Architectural Design, ECEN Architectural Design Architecture Business Cycle Design for Maintainability ECEN 5543 / CSCI 5548 SW Eng.
Fall 2009ACS-3913 Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Date: 1753 an interpretation.
Feb 4, Ron McFadyen1 founded on principles of good OO design idea was first put forth by Christopher Alexander (1977) in their work concerning.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
Chapter 18 Object Design Examples with GRASP. Objectives Design use case realizations –A use-case realization describes how a particular use case is realized.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Chapter 17. GRASP General Responsibility Assignment Software Patterns (Principles) OOD: after identifying requirements, create domain model, define responsiblities.
BTS430 Systems Analysis and Design using UML Domain Model Part 1—Finding Conceptual Classes.
1 SAD2 - UML 4 th Lecture Class Diagram in Construction Phase Patterns Case Study Lecturer: Dr Dimitrios Makris
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Architecture GRASP Realization of use cases in interaction diagrams Design class diagram Design ( how )
Requirements To Design--Iteratively Chapter 12 Applying UML and Patterns Craig Larman.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
BTS430 Systems Analysis and Design using UML Design Patterns.
Chapter 17. Initial Object Design Inputs: requirements meetings various Use Cases – 10% complete Key risks addressed with preliminary programming System.
GRASP: Designing Objects With Responsibilities
Object-Oriented Analysis and Design Mar 11, 2008.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
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.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
Copyright © Craig Larman All Rights Reserved Responsibility-Driven Design with the GRASP Patterns.
Object-Oriented Design Part 2
Systems Analysis and Design in a Changing World, 3rd Edition
GRASP: Designing Objects with Responsibilities
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Object Design and Use- Case Realizations with GRASP Patterns.
What to remember from Chap 13 (Logical architecture)
Object-Oriented Analysis and Design Mar 9, 2008.
TK2023 Object-Oriented Software Engineering CHAPTER 12 Introduction to Responsibility-Driven Design.
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
OO Design Roshan Chitrakar. Analysis to Design Do the RIGHT thing Do the RIGHT thing Requirement Analysis Requirement Analysis Domain Modeling with addition.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Copyright © Craig Larman All Rights Reserved COMP-350 Object-Oriented Analysis and Design GRASP: Designing Objects with Responsibilities Reference:
Chapter 17 Designing with Responsibilities. Fig
OO Methodology Elaboration Phase Iteration 1- Part 3.
Design. 2 The Need for Software Blueprints Knowing an object-oriented language and having access to a library is necessary but not sufficient in order.
General Principles in Assigning Responsibilities Responsibilities Responsibility-Driven Design CRC Cards GRASP.
Elaboration: Iteration 2. Elaboration: Iteration 2 Basics Iteration 1 ends with : All the software has been tested: The idea in the UP is to do early,
Object Design Examples with GRASP
GRASP – Designing Objects with Responsibilities
Chapter 12: Collaboration Diagram - PART2
Conception OBJET GRASP Patterns
Week 10: Object Modeling (1)Use Case Model
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
Apply Expert, Creator, Controller, Low Coupling, High Cohesion
The Object Oriented Approach to Design
GRASP : Designing Objects with Responsibilities
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
Object Oriented System Design Responsibilities
Presentation transcript:

SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler

Midterm Review Midterm Wednesday 18 October 2006 at 13:20 for 60 minutes Midterm covers Larman chapters 1 to 21 –But emphasis on chapters 17, 13, 19, 18 Nothing from Fowler’s EAA –but layers, MVC included You need to –write Java code and –draw UML diagrams

Midterm Review Week 1

Basic Questions (Let’s Discuss) What is software design? How is it different from software programming? Software development? How do we design software? What is the role of objects, layers, architecture,..? What is the role of tests, responsibilities, patterns, models, …? How does design fit into the software lifecycle? What is good design? How does software design differ from … design?

Course Objectives “Think in Objects” Analyze requirements with use cases Create domain models Apply an iterative & agile Unified Process (UP) Relate analysis and design artifacts Read & write high- frequency UML Practice Apply agile modeling Design object solutions –Assign responsibilities to objects –Design collaborations –Design with patterns –Design with architectural layers –Understand OOP (e.g., Java) mapping issues

What the course is: A (first) look at OO design! Design process: domain model, use cases, design Emphasis: models, GRASP principles, design patterns, responsibility, collaboration Mentions: RDD, TDD, MDD, extensibility Closely follows textbook!

What is OO Analysis and Design Object-Oriented Analysis –Important domain concepts or objects? –Vocabulary? –Visualized in the UP Domain Model Object-Oriented Design –Design of software objects –Responsibilities –Collaborations –Design patterns –Visualized in the UP Design Model

Important Concepts Model Abstraction hiding (unimportant) details Eg, cover of Larman’s book GRASP Principle for assigning responsibility Design pattern Solution to design problem in context Eg, Command pattern

Responsibility-Driven Design (RDD) Detailed object design is usually done from the point of view of the metaphor of: –Objects have responsibilities –Objects collaborate Responsibilities are an abstraction. –The responsibility for persistence. Large-grained responsibility. –The responsibility for the sales tax calculation. More fine-grained responsibility.

The 9 GRASP Principles 1.Creator 2.Information Expert 3.Controller 4.Low Coupling 5.High Cohesion 6.Polymorphism 7.Pure Fabrication -- NO 8.Indirection -- NO 9.Protected Variations -- NO

Midterm Review Week 2

OO Basics: Static vs. Dynamic Typing Why not declare all fields or variables of reference types as –Object –void * (C++) What would we gain? What would we loose?

Midterm Review Week 3

What is Design? Developing a blueprint (plan) for a mechanism that performs the required task, … taking into account all the constraints, & … making trade-offs between constraints when they are in conflict.

Evolutionary Design What is the probability that a S/W design will need to be updated? Change is inevitable, evolutionary design recognizes this. As software is changed, generally it becomes more complex unless effort is made to keep it simple.

Prerequisites to Successful Evolutionary Design? Testing –… lots of automated testing. Refactoring –… keeping the design simple. Continuous integration Actually, testing is a prerequisite to refactoring.

Can you pick out a good design? What is a good design? –Satisfies user needs. –Is a simple as possible. Kent Beck: Runs all tests Reveals intention. No duplication. Fewest number of classes or methods … can you smell bad design choices?

Test Driven Design Write tests first. –Why does it make sense to write tests first? TDD in its pure form –Do not add any (product) code unless a test failing.

Responsibility-Driven Design (RDD) Detailed object design is usually done from the point of view of the metaphor of: –Objects have responsibilities –Objects collaborate Responsibilities are an abstraction. –The responsibility for persistence. Large-grained responsibility. –The responsibility for the sales tax calculation. More fine-grained responsibility.

Object Responsibilities A responsibility is an obligation of an object in terms of its behavior. (More on this later)

Information Expert “… expresses the common ‘intuition’ that objects do things related to the information they have.” Assign the responsibility for “knowing” [something] to the object (class) that has the information necessary to fulfill the responsibility.

Creator Assign to class B the responsibility to create an instance of class A if –B aggregates A objects. –B contains A objects. –B records instances of A objects. –B closely uses A objects. –B has the initializing data that will be passed to A when it is created.

GRASP: Polymorphism Principle Larman: When related alternatives or behaviors vary be type (class), assign responsibility for the behavior—using polymorphic operations—to the types for which the behavior varies. (This principle was illustrated last week with the Animal hierarchy.)

Responsibilities – A Boat Metaphor What kind of responsibilities do each of the following “objects” have: … –To know. –To do. –To decide.

Midterm Review Week 4

Design Principles Design for change

Cohesion Measure of the degree of “relatedness” that elements within a module share. Degree to which the tasks performed by a single module are functionally related. Brain storm: –Why put procedures/methods together within a module/class?

Coupling Measures the degree of dependency that exists between modules. Brain storm: –Give examples of code that creates coupling.

Design – Repeat Successes Has a (successful) similar product been built? Yes, then reuse domain specific: –Architectural Style (e.g. client/server, database, process control) Patterns. –Design Patterns (& idioms). Use Domain model as source of inspiration.

Design – New Application Area? Has a (successful) similar product been built? No, then choose among general: –Architectural Style (e.g. client/server, database, process control) Patterns. –Design Patterns (& idioms). Use Domain model as source of inspiration.

Layering – General Scheme Layers Presentation / Application. –UI. –Generally “thin”. –(Term “application” can be misleading. It does not mean …) Domain / Business Logic. –Core system functionality. Technical Services.

Domain Logic (Layer) “… also referred to as business logic. … It involves calculations based on inputs and stored data, validation of any data that comes in from the presentation, and figuring out exactly what data source logic to dispatch …” [Fowler, p.20]

Layered Style Characteristics Each layer offers services to layers above. Hence, layers build upon each other to provide increased functionality.

Midterm Review Week 5

Design Model

Logical Architecture – Simple Layers

Model-View-Control Architecture (MVC) Model maintains the state and data of the application - the XML document View A rendering of the XML document Controller The user interface presented to the user to manipulate the application

Traceability

PATTERN: Controller (Larman 17.13) Problem: What object in the domain (or application coordination layer) receives requests for work from the UI layer? System operations (see SSD): major input events to the system The controller is the first object beyond the UI layer that is responsible for receiving or handling a system operations message. Note that UI objects delegate system operation request to a controller.

PATTERN: Controller (Larman 17.13) Solution: Assign the responsibility to a class representing one of the following choices: A façade controller, which represents 1.the overall system 2.A root object 3.A device that the software is running within, or 4.A major subsystem A use case or session controller which represents a use case scenario in which the system operation occurs

Designing for Visibility Fact: To send a message to B, A must have visibility to B. It doesn’t happen by “magic.” Kinds of visibility: –Attribute –Parameter –Local –Global Larman ch 19

Midterm Review Week 6

Encapsulation A programming/design language mechanism. A packaging / scoping mechanism for names –Names can refer to data, types, … –Especially, a means of packaging data. Access points at interface

Information Hiding Design principle by which a module is assigned a “secret”. A module’s secret is usually –A design decision. What type of design decisions might we want to hide from the clients of a module?