Implementation Goals: “map” design to clean, efficient code Document any design changes found to be useful Produce code that is correct, modular, understandable,

Slides:



Advertisements
Similar presentations
Building Bug-Free O-O Software: An Introduction to Design By Contract A presentation about Design By Contract and the Eiffel software development tool.
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Database Systems: Design, Implementation, and Management Tenth Edition
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
OBP Research Oy for simpler creation of embedded systems.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 7, Object Design.
Free Mini Course: Applying UML 2.0 with MagicDraw.
Object Oriented Design An object combines data and operations on that data (object is an instance of class) data: class variables operations: methods Three.
Information Retrieval in Practice
Conquering Complex and Changing Systems Object-Oriented Software Engineering TJSS System Design Lecture 12 Päivi Ovaska.
Software Testing and Quality Assurance
File Systems and Databases
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Feb. 23, 2004CS WPI1 CS 509 Design of Software Systems Lecture #5 Monday, Feb. 23, 2004.
Chapter 1 Principles of Programming and Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Use Case Analysis – continued
20 February Detailed Design Implementation. Software Engineering Elaborated Steps Concept Requirements Architecture Design Implementation Unit test Integration.
Overview of Search Engines
Software Reengineering 2003 년 12 월 2 일 최창익, 고광 원.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Extreme Programming.
Introduction to Databases and Database Languages
CS 8532: Adv. Software Eng. – Spring 2007 Dr. Hisham Haddad Tuesday Class will start momentarily. Please Stand By … CS 8532: Advanced Software.
Exam examples Tor Stålhane. The A scenario – 1 We are working in a small software development company – 10 developers plus two persons in administrative.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Operation, Algorithm, and Data Structure Specification, and Design Finalization.
CSE 303 – Software Design and Architecture
1 Chapter 5 Practice: A Generic View Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
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.
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
Implementation Goals: “map” design to clean, efficient code Document any design changes found to be useful Produce code that is correct, modular, understandable,
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 10 Use Case Design.
CSE 219 Computer Science III Program Design Principles.
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Design Analysis builds a logical model that delivers the functionality. Design fully specifies how this functionality will be delivered. Design looks from.
Data Abstaraction Chapter 10.
Software Design: Principles, Process, and Concepts Getting Started with Design.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Mapping Models to Code. We will skip most of this chapter –It deals with how to go from UML class diagrams to actual code –You should already have a pretty.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 11 Object-Oriented.
Winter 2011SEG Chapter 11 Chapter 1 (Part 1) Review from previous courses Subject 1: The Software Development Process.
March 1, 2004CS WPI1 CS 509 Design of Software Systems Lecture #6 Monday, March 1, 2004.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Class Diagrams. Terms and Concepts A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their relationships.
CSIS 4850: CS Senior Project – Spring 2009 CSIS 4850: Senior Project Spring 2009 Object-Oriented Design.
Chapter 2 Principles of Programming and Software Engineering.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Principles of Programming. Achieving an Object-Oriented Design  Abstraction and Information Hiding  Object-Oriented Design  Functional Decomposition.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
CS223: Software Engineering Lecture 19: Unit Testing.
Principles of Programming & Software Engineering
CSC 222: Computer Programming II
Chapter 11 Object-Oriented Design
Principles of Programming and Software Engineering
Unit Test Pattern.
Chapter 13 Quality Management
CS 8532: Advanced Software Engineering
Software Analysis.
CMPE/SE 131 Software Engineering March 7 Class Meeting
Presentation transcript:

Implementation Goals: “map” design to clean, efficient code Document any design changes found to be useful Produce code that is correct, modular, understandable, modifiable Reduce errors which creep in during “transformations” (e.g., Lord of the Rings example, Ch. 10 of Bruegge & Dutoit)) Implementation / Coding RequirementsDesignSpecsVersion 1Version 2

Guiding principles: 1. “do the simplest thing that works” 2. Make good choices (array vs linked list; bubblesort vs quicksort; separate classes vs inheritance; etc.) 3. DOCUMENT!!!!!!!—keep code and documentation consistent

Types of transformations 1.model transformation 2.refactoring 3.forward engineering 4.reverse engineering

Model transformation: Simplify or optimize, e.g., --recognize that different types of events can be organized as children of an EVENT class --get rid of a redundant attribute (figure 10.2, p. 397)

Refactoring Change the source code to improve its readability or modifiability “pull up”: do in small incremental steps to check that behavior is appropriate Example: pp : field constructor body method

Forward engineering: Use previously developed code to generate similar statements Example: p. 400

Reverse engineering: Recreate the model for an existing system

Principles of transformation: 1.One transformation addresses only one criterion for ONE design goal 2.A transformation must be local 3.Each transformation must be applied in isolation to other changes 4.Each transformation must be validated Q: how does this apply to coding habits?

Mapping activities: 1. optimizations 2.realizing associations between objects, classes 3.handling exceptions (“broken contracts”) 4.choosing a storage schema (e.g., in a database)

Useful mapping concepts for the object design model (examples): Access paths: does a sequence diagram show many similar traversals? Then you might want to create a direct path between the two objects If one class is accessing many objects of the same type, you might want to make the collection an indexed one to save time do some attributes in the called class really belong in the calling class?

Collapsing objects: Should some objects really be attributes? Delaying expensive computations Example: drawing an image—don’t create the image object until it is needed Caching the result of expensive computations Example: statistics calculations which will be referred to later in the program

Using efficient associations : Is the association: Unidirectional 1-1? Figure 10.8—account is private so that callers cannot accidentally modify account number Bidirectional 1-1? Figure 10.9—if an account has a reference to an advertiser, the advertiser must have a reference to that account—if changes are made, both classes must be recompiled Bidirectional 1-many? Figure 10.10—here the accounts are a “collection”—they might need to be ordered or unordered Many-many? Figure 10.11—2 lists—both must be consistent

“qualified” association—figure May be able to use an “association class”— e.g., statistics, figure 10.13—this class holds binary associations

Mapping contracts to exceptions Java: throw / catch Simple method: check preconditions check postconditions check invariants encapsulate checking code into methods to deal with inheritance

Robust* procedure but may not be realistic * The word robust, when used with regard to computer software, refers to an operating system or other program that performs well not only under ordinary conditions but also under unusual conditions that stress its designers' assumptions. … operating systemprogram The Rule of Robustness in the Unix philosophy states that robustness results from transparency and simplicity. Software is transparent when a skilled programmer can examine its source code (i.e., the original version written by a human in a programming language) and soon comprehend how it works. It is simple when its operation is sufficiently uncomplicated that a programmer can visualize with little effort all of the potential situations that it might encounter. The more that programs have both of these qualities, the more robust they will be.source code Another important tactic for creating robust software is to write general code that can accommodate a wide range of situations and thereby avoid having to insert extra code into it just to handle special cases. This is because code added just to accommodate special cases is often buggier than other code, and stability problems can become particularly frequent and/or severe from the interactions among several such sections of code. accessed 07/27/2010

Why is above procedure unrealistic? added code may be very long and complex, effort creating it may be better spent elsewhere more code means more chances for bugs code for checking is difficult to modify when original code is modified, this may leas to more bugs (“obfuscated code”) added code reduces performance efficiency

Heuristics for code-checking—do you agree with these? Omit checking postconditions and invariants—these are typically written by the code developer, tests should be written by an independent party Focus on subsystem interfaces—these are likely to be boundaries between developers; put less emphasis on checking private and protected methods Focus on components with the longest life, i.e., entity objects as opposed to interface objects Reuse constraint checking code where possible DOCUMENT the checking with comments

[Persistent storage mapping—we will not cover this, it is more relevant to databases]

Managing implementation: Core architect: selects transformations to be applied, e.g., storage method Architecture liaison: documents contracts for subsystem interfaces, keeps everyone up to date about these Developer: follows core architect’s conventions, converts object design model to source code, keeps source code documentation up to date

Ensuring consistency: --use tools consistently, don’t change development tools when your are working on a given transformation --keep the contracts in the source code, not in the object design model—this will increase the probability that they will be updated as needed --use the same names for the same objects --make transformations explicit

Question: is your coding style consistent with the recommendations given here?