CS 509 Design of Software Systems - PowerPoint PPT Presentation

About This Presentation
Title:

CS 509 Design of Software Systems

Description:

New assignments will be posted to web site. Discuss possible topics for CS562. Feb. 23, 2004 ... Types, signatures & visibility. Contracts on classes and methods: ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 30
Provided by: DianeK82
Learn more at: http://web.cs.wpi.edu
Category:

less

Transcript and Presenter's Notes

Title: CS 509 Design of Software Systems


1
CS 509Design of Software Systems
  • Lecture 5
  • Monday, Feb. 23, 2004

2
Class Format for Today
  • Term Project Administration
  • Changes to Course Material
  • Questions
  • Quiz 3
  • Review of Chapters 8 9
  • In-class Exercise
  • Requirements for new design project

3
Term Project Administration
  • Return Phase 2 Functional Specifications
  • And Journals
  • Return Quiz 2
  • About Phase 3
  • How is the project progressing?
  • Can we continue as planned?
  • System Object Design for CTS due next week
  • Have you started object design, or do you prefer
    to just focus on system design?

4
Changes to Course Material
  • Next week start on a new project to design
  • Home Inventory System (thanks to Michael)
  • Discuss requirements later tonight
  • Presentations or 2 phases for last month?
  • Readings lecture topics
  • Read Chapter 10 for next week
  • New assignments will be posted to web site
  • Discuss possible topics for CS562

5
Questions?
  • About what was covered last time
  • From the reading
  • About the Term Project
  • Anything else?

6
Quiz 3
  • Chapters 7, 8, 9
  • You have 15 minutes

7
Chapter 8
  • Object Design
  • Reusing Pattern Solutions

8
Overview of Activities
  • Reuse (Chapter 8)
  • Pick off-the-shelf components design patterns
  • Service specification (Chapter 9)
  • Precisely describe each class interface
  • Object model restructuring (Chapter 10)
  • Improve understandability extensibility
  • Optimizations to address performance criteria
    (time, memory, etc.)

9
Purpose of Object Design
  • Close the gap between application objects and
    selected hardware/software platforms
  • Identify missing functionality not covered by
    system design
  • Construct precise specifications of classes,
    attributes and operations
  • Produce a model from which a set of classes can
    be implemented by individual developers

10
Reuse
  • Off-the-shelf components identified during system
    design need to be integrated
  • Class libraries 3rd party components selected
    for basic data structures services
  • Wrapping components with custom objects
  • Refining them using inheritance
  • Design patterns selected for solving common
    problems isolating the effects of change

11
Interface Specifications
  • Subsystem services identified during system
    design specified in terms of class interfaces
  • Operations Arguments
  • Type signatures
  • Constraints Exceptions
  • Identify operations objects needed to transfer
    data among subsystems

12
Restructuring
  • Transforming optimizing the object model should
    occur after classes objects have been designed
    interfaces fully specified
  • Often design activities can get side-tracked by
    optimization concerns
  • Focusing on interfaces, components design
    patterns results in a more flexible design model
  • Focusing on optimizations first tends to produce
    design model that is rigid difficult to modify

13
Reuse Concepts
  • Application Objects vs. Solution Objects
  • Inheritance vs. Delegation
  • The Liskov Substitution Principle
  • Design Patterns
  • Application Frameworks

14
Application Solution Objects
  • Application domain objects come from the
    requirements analysis
  • Boundary, Control, Entity
  • Represent concepts in the problem domain
  • Solution objects developed during design
  • Represent concepts with no counterparts in the
    problem domain

15
Inheritance vs. Delegation
  • Review Set/Hashtable example on pgs 310-311
  • Discuss distinction between inheritance and
    delegation
  • Which one is better? Why?
  • Is it a general rule, or better only in this
    case?
  • Are there cases where the other is better?
  • How does inheritance relate to taxonomy?

16
Liskov Substitution Principle
  • If an object of type S can be substituted in
    all the places where an object of type T is
    expected, then S is a subtype of T.
  • Who can interpret what this means?
  • Examples?

17
Intro to Design Patterns
  • Purpose
  • Template solutions to recurring problems
  • History
  • Patterns evolve over time
  • Refined for maximizing reuse flexibility
  • Capture Knowledge
  • Document context trade-offs
  • Provide guidance about when to use inheritance
    vs. delegation

18
Design Pattern Participants
  • Client Class
  • Accesses the pattern
  • Pattern Interface
  • Part of pattern that is visible to the client
  • Implementor Class(es)
  • Provides low-level behavior (may be gt 1)
  • Extender Class
  • Provides a specialized implementation or extended
    behavior

19
Design Patterns
  • Adapter
  • Bridge
  • Strategy
  • Abstract Factory
  • Command
  • Composite

20
Application Frameworks
  • Terminology
  • Hook Method
  • Infrastructure Framework
  • Middleware Framework
  • Enterprise Application Framework
  • White Box Framework
  • Black Box Framework

21
Chapter 9
  • Object Design
  • Specifying Interfaces

22
Activities Overview
  • Identify missing attributes operations
  • Specify type signatures visibility
  • Specify contracts on classes methods

23
Interface Spec. Concepts
  • Participants
  • Class implementor
  • Class extender
  • Class user (client)
  • Types, signatures visibility
  • Contracts on classes and methods
  • Invariants, pre- and post-conditions

24
Participants
  • Class Implementor
  • Realizes the class
  • Class User (Client)
  • Invokes operations provided by the class
  • Class Extender
  • Develops specializations of the class

25
Types, Signatures Visibility
  • Type specifies range of valid values
  • For attribute, parameters method return
  • Examples?
  • Signature specifies method
  • Name, param types, return type
  • Visibility specifies who can see what
  • Private, protected, public
  • What does each mean?

26
Contracts on Classes, Methods
  • Invariants
  • Predicate true for all instances of a class
  • Pre-conditions
  • Predicate true before an operation is invoked
  • Post-conditions
  • Predicate true after an operation has completed
  • Purpose?
  • Examples?

27
Object Constraint Language
  • Formal language for specifying contracts
  • Constraints should be specified in design
    document, but may be done more informally
  • Contracts should also be documented in code,
    using comments.
  • See example code on page 358

28
In-class Exercise
  • Requirements for
  • Home Inventory System

29
For Next Time
  • Phase 3 due (Design Documents)
  • Read Chapter 10 Mapping Models to Code
  • Check course web site for updates
  • Syllabus
  • Reading material
  • Term project
  • I will send email to the class when updated
Write a Comment
User Comments (0)
About PowerShow.com