Download presentation
Presentation is loading. Please wait.
Published byBrett Rose Modified over 8 years ago
1
March 1, 2004CS 509 - WPI1 CS 509 Design of Software Systems Lecture #6 Monday, March 1, 2004
2
March 1, 2004CS 509 - WPI2 §Term Project Administration §Questions §Review of Chapter 10 §In-class Exercises: l Discuss contents of new text book, choose lecture topics l Review requirements for HIS Class Format for Today
3
March 1, 2004CS 509 - WPI3 Term Project Administration §Phase 3 – CIS Design (and journals) due §Return Quiz #3 §Hand out Phase 4 assignment §Change to grading policy: P4 5%, P5 10% §Phase 4 discussion l Only have 1 week for analysis l Would it be more or less productive to have larger groups for phase 4? 2 groups of 4 instead of 4 groups of 2?
4
March 1, 2004CS 509 - WPI4 Questions? §About what was covered last time §From the reading §About the Term Project §Anything else?
5
March 1, 2004CS 509 - WPI5 Chapter 10 Mapping Models to Code
6
March 1, 2004CS 509 - WPI6 Overview of Activities §What are the purposes of the activities in this chapter? l Optimizing the class model l Mapping associations to collections l Mapping operation contracts to exceptions l Mapping the class model to a storage schema
7
March 1, 2004CS 509 - WPI7 Optimizations §Address performance requirements of system model §Optimizing associations: l Reducing multiplicity l Adding redundancy l Why do each of the above? §Adding derived attributes
8
March 1, 2004CS 509 - WPI8 Transformations §Model transformations §Refactorings §Forward engineering §Reverse engineering
9
March 1, 2004CS 509 - WPI9 Model Transformations §Applied to an object model, produces another object model §Purpose: l To simplify or optimize original model l To bring into closer compliance with requirements §Actions: l Add, remove or rename classes, operations, associations and/or attributes
10
March 1, 2004CS 509 - WPI10 Refactoring §Transformation of source code §Improve readability or modifiability without changing behavior §Focus on a specific field or method of class §Done in small incremental steps interwoven with testing §Examples: (What do they do?) l Pull Up Field, Pull Up Constructor, Pull Up Method
11
March 1, 2004CS 509 - WPI11 Forward Engineering §Applied to a set of model elements §Results in a set of source code statements: l Class declaration, expression, DB schema §Maintain strong correspondence between object design model & code §Reduce number of errors introduced during implementation
12
March 1, 2004CS 509 - WPI12 Reverse Engineering §Applied to source code §Results in a set of model elements §Recreate the model for an existing system l Why? §Does not necessarily create original model l Why not?
13
March 1, 2004CS 509 - WPI13 Transformation Principles §Goal is to improve design §Making changes is potentially hazardous §How to avoid introducing new errors: l Address a single criteria or design goal l Local transformations, not architectural changes l Applied in isolation to other changes (how?) l Followed by testing to validate
14
March 1, 2004CS 509 - WPI14 Optimizing for Performance §Increase in performance may result in more complexity §Want a balance between efficiency & clarity l Minimize repeated association traversals l Reduce “many” associations to “one” l Eliminate unneeded classes by moving attributes
15
March 1, 2004CS 509 - WPI15 More Optimizations §Collapsing objects into attributes l How do you know where this applies? l When should this activity be done? §Delaying expensive computations l Proxy design pattern may be useful §Caching results of expensive computations l Data can be stored temporarily (time vs. space) l Need to be careful about when to update
16
March 1, 2004CS 509 - WPI16 Mapping Associations §Associations in UML have no direct counterpart in Java §Can map to reference or collection §Unidirectional vs. bi-directional §One-to-one, one-to-many, many-to-many §Qualified associations §Association classes
17
March 1, 2004CS 509 - WPI17 From Contracts to Exceptions §Contracts are mapped to exceptions using a corresponding check in the code (an if statement) that throws an exception if a contract condition is not satisfied l When is it necessary to check contract conditions? l How do inheritance and encapsulation apply?
18
March 1, 2004CS 509 - WPI18 Persistent (Relational) Storage §Mapping object models to persistent storage required defining a schema §Tables and keys: l Primary key, candidate key, foreign key §Map each class to a table of the same name §Map attributes to columns in table §Choose primary key (how?)
19
March 1, 2004CS 509 - WPI19 Association Relationships §Buried associations with multiplicity one l Why is this called a buried association? l How does it work? §Association (or Bridge) Table l What is a bridge table? l What is it used for? l How does it work?
20
March 1, 2004CS 509 - WPI20 Mapping Inheritance §Vertical mapping l Typo in book on page 418 (sub vs. super) §Horizontal mapping §What are the differences? The trade-offs? l Which one has a “role” column? l What is it for?
21
March 1, 2004CS 509 - WPI21 In-class Exercises §Discuss contents of new text book §Choose lecture topics for: l 3/8, 3/15, 3/22 §Review requirements for HIS l Work on defining attributes for categories
22
March 1, 2004CS 509 - WPI22 For Next Time §Phase 4 due (HIS RAD) and Journals §Reading TBD §Think about course content for CS562
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.