Download presentation
Presentation is loading. Please wait.
1
Feb. 23, 2004CS 509 - WPI1 CS 509 Design of Software Systems Lecture #5 Monday, Feb. 23, 2004
2
Feb. 23, 2004CS 509 - WPI2 §Term Project Administration §Changes to Course Material §Questions §Quiz #3 §Review of Chapters 8 & 9: §In-class Exercise: l Requirements for new design project Class Format for Today
3
Feb. 23, 2004CS 509 - WPI3 Term Project Administration §Return Phase 2 – Functional Specifications l And Journals §Return Quiz #2 §About Phase 3: l How is the project progressing? l Can we continue as planned? System & Object Design for CTS due next week l Have you started object design, or do you prefer to just focus on system design?
4
Feb. 23, 2004CS 509 - WPI4 Changes to Course Material §Next week start on a new project to design l Home Inventory System (thanks to Michael) l Discuss requirements later tonight §Presentations or 2 phases for last month? §Readings & lecture topics: l Read Chapter 10 for next week l New assignments will be posted to web site §Discuss possible topics for CS562
5
Feb. 23, 2004CS 509 - WPI5 Questions? §About what was covered last time §From the reading §About the Term Project §Anything else?
6
Feb. 23, 2004CS 509 - WPI6 Quiz #3 Chapters 7, 8, 9 You have 15 minutes
7
Feb. 23, 2004CS 509 - WPI7 Chapter 8 Object Design: Reusing Pattern Solutions
8
Feb. 23, 2004CS 509 - WPI8 Overview of Activities §Reuse (Chapter 8) l Pick off-the-shelf components & design patterns §Service specification (Chapter 9) l Precisely describe each class interface §Object model restructuring (Chapter 10) l Improve understandability & extensibility l Optimizations to address performance criteria (time, memory, etc.)
9
Feb. 23, 2004CS 509 - WPI9 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
Feb. 23, 2004CS 509 - WPI10 Reuse §Off-the-shelf components identified during system design need to be integrated l Class libraries & 3 rd party components selected for basic data structures & services l Wrapping components with custom objects l Refining them using inheritance §Design patterns selected for solving common problems & isolating the effects of change
11
Feb. 23, 2004CS 509 - WPI11 Interface Specifications §Subsystem services identified during system design specified in terms of class interfaces l Operations & Arguments l Type signatures l Constraints & Exceptions §Identify operations & objects needed to transfer data among subsystems
12
Feb. 23, 2004CS 509 - WPI12 Restructuring §Transforming & optimizing the object model should occur after classes & objects have been designed & interfaces fully specified l Often design activities can get side-tracked by optimization concerns l Focusing on interfaces, components & design patterns results in a more flexible design model l Focusing on optimizations first tends to produce design model that is rigid & difficult to modify
13
Feb. 23, 2004CS 509 - WPI13 Reuse Concepts §Application Objects vs. Solution Objects §Inheritance vs. Delegation §The Liskov Substitution Principle §Design Patterns §Application Frameworks
14
Feb. 23, 2004CS 509 - WPI14 Application & Solution Objects §Application domain objects come from the requirements & analysis l Boundary, Control, Entity l Represent concepts in the problem domain §Solution objects developed during design l Represent concepts with no counterparts in the problem domain
15
Feb. 23, 2004CS 509 - WPI15 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
Feb. 23, 2004CS 509 - WPI16 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
Feb. 23, 2004CS 509 - WPI17 Intro to Design Patterns §Purpose: l Template solutions to recurring problems §History: l Patterns evolve over time l Refined for maximizing reuse & flexibility §Capture Knowledge: l Document context & trade-offs l Provide guidance about when to use inheritance vs. delegation
18
Feb. 23, 2004CS 509 - WPI18 Design Pattern Participants §Client Class l Accesses the pattern §Pattern Interface l Part of pattern that is visible to the client §Implementor Class(es) l Provides low-level behavior (may be > 1) §Extender Class l Provides a specialized implementation or extended behavior
19
Feb. 23, 2004CS 509 - WPI19 Design Patterns §Adapter §Bridge §Strategy §Abstract Factory §Command §Composite
20
Feb. 23, 2004CS 509 - WPI20 Application Frameworks §Terminology: l Hook Method l Infrastructure Framework l Middleware Framework l Enterprise Application Framework l White Box Framework l Black Box Framework
21
Feb. 23, 2004CS 509 - WPI21 Chapter 9 Object Design: Specifying Interfaces
22
Feb. 23, 2004CS 509 - WPI22 Activities Overview §Identify missing attributes & operations §Specify type signatures & visibility §Specify contracts on classes & methods
23
Feb. 23, 2004CS 509 - WPI23 Interface Spec. Concepts §Participants: l Class implementor l Class extender l Class user (client) §Types, signatures & visibility §Contracts on classes and methods: l Invariants, pre- and post-conditions
24
Feb. 23, 2004CS 509 - WPI24 Participants §Class Implementor l Realizes the class §Class User (Client) l Invokes operations provided by the class §Class Extender l Develops specializations of the class
25
Feb. 23, 2004CS 509 - WPI25 Types, Signatures & Visibility §Type specifies range of valid values: l For attribute, parameters & method return l Examples? §Signature specifies method: l Name, param types, return type §Visibility specifies who can see what l Private, protected, public l What does each mean?
26
Feb. 23, 2004CS 509 - WPI26 Contracts on Classes, Methods §Invariants l Predicate true for all instances of a class §Pre-conditions l Predicate true before an operation is invoked §Post-conditions l Predicate true after an operation has completed §Purpose? §Examples?
27
Feb. 23, 2004CS 509 - WPI27 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
Feb. 23, 2004CS 509 - WPI28 In-class Exercise Requirements for Home Inventory System
29
Feb. 23, 2004CS 509 - WPI29 For Next Time §Phase 3 due (Design Documents) §Read Chapter 10 – Mapping Models to Code §Check course web site for updates l Syllabus l Reading material l Term project §I will send email to the class when updated
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.