1 CS 501 Spring 2005 CS 501: Software Engineering Lecture 16 Object Oriented Design 2.

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Advertisements

Object-Oriented Analysis and Design
Introduction To System Analysis and Design
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
CS CS 5150 Software Engineering Lecture 15 Object Oriented Design 1.
1 CS 501 Spring 2007 CS 501: Software Engineering Lecture 16 Object Oriented Design 2.
1 CS 501 Spring 2003 CS 501: Software Engineering Lecture 18 Object Oriented Design II.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
1 CS 501 Spring 2008 CS 501: Software Engineering Lecture 16 Object Oriented Design 2.
CS 501: Software Engineering Fall 2000 Lecture 11 Object-Oriented Design I.
1 Objectives To introduces the concept of software Design. To introduce the concept of Object- Oriented Design (OOD). To Define various aspects about object.
CS CS 5150 Software Engineering Lecture 15 Object Oriented Design 1.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented design 2.
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
©Ian Sommerville 2006Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
CS 432 Object-Oriented Analysis and Design
© Copyright Eliyahu Brutman Programming Techniques Course.
1 CS 501 Spring 2008 CS 501: Software Engineering Lectures 15 Object Oriented Design 1.
CS 501: Software Engineering Fall 2000 Lecture 13 Object-Oriented Design III.
CS CS 5150 Software Engineering Lecture 16 Object Oriented Design 2.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 16 Object Oriented Design I.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Introduction To System Analysis and design
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
CS 5150 Software Engineering Lecture 15 Program Design 2.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
The Design Discipline.
CS CS 5150 Software Engineering Lecture 18 Program Design 3.
An Introduction to Software Architecture
CS 501: Software Engineering Fall 1999 Lecture 18 (a) Project Reports (b) Object-Oriented Design III.
Introduction to the Unified Modeling Language “The act of drawing a diagram does not constitute analysis or design. … Still, having a well-defined and.
CS CS 5150 Software Engineering Lecture 17 Object Oriented Design 3.
Introduction To System Analysis and Design
1 CS 501 Spring 2006 CS 501: Software Engineering Lecture 17 Object Oriented Design 3.
Systems Analysis and Design in a Changing World, 3rd Edition
CS CS 5150 Software Engineering Lecture 15 Program Design 1.
Software Engineering Lecture 10 UML vs. ERD.
L6-S1 UML Overview 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College.
CS 360 Lecture 10.  Software is expensive.  Most software development makes extensive use of existing software.  Developers avoid building new software.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
OBJECT ORIENTED AND FUNCTION ORIENTED DESIGN 1 Chapter 6.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Software Engineering Lecture 8 Object-Oriented Analysis.
 Building Block Building Block  Things in the UML Things in the UML  Structural Things Structural Things  Behavioral Things Behavioral Things  Grouping.
Object Oriented Analysis and Design 1 Chapter 9 From Design to Implementation  Implementation Model  Forward, Reverse, and Round-Trip Engineering  Mapping.
1 CS 501 Spring 2003 CS 501: Software Engineering Lecture 23 Performance of Computer Systems.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
CS 5150 Software Engineering Lecture 17 Program Design 4/ Security & Privacy.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 17 Object Oriented Design II.
CS 501: Software Engineering Fall 1999 Lecture 15 Object-Oriented Design I.
Legacy Systems and Software Reuse CS 560. Economics Software is expensive.  Most software development makes extensive use of existing software.  Developers.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
CS 501: Software Engineering Fall 1999 Lecture 22 (a) Managing the Software Process (b) Software Reuse.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 15 System Architecture III.
CS 501: Software Engineering Fall 1999 Lecture 23 Design for Usability I.
Analysis Classes Unit 5.
CHAPTER
UML Diagrams By Daniel Damaris Novarianto S..
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Unified Modeling Language
CS 501: Software Engineering
CS 501: Software Engineering
An Introduction to Software Architecture
CS 501: Software Engineering
Presentation transcript:

1 CS 501 Spring 2005 CS 501: Software Engineering Lecture 16 Object Oriented Design 2

2 CS 501 Spring 2005 Administration

3 CS 501 Spring 2005 Candidate Classes: Solution Classes Application classes and solution classes: Application classes represent application concepts. Noun identification is an effective technique to generate candidate application classes. Solution classes represent system concepts, e.g., user interface objects, databases, etc.

4 CS 501 Spring 2005 From Candidate Classes to Completed Design Methods used to move to final design: Reuse: Wherever possible use existing components, or class libraries. They may need modification. Restructuring: Change the design to improve, understandability, maintainability, etc. Techniques include merging similar classes, splitting complex classes, etc. Optimization: Ensure that the system meets anticipated performance requirements, e.g., by changed algorithms or restructuring. Completion: Fill all gaps, specify interfaces, etc.

5 CS 501 Spring 2005 An Exam Question: Object Oriented Design A system generates weather maps using data collected from unattended weather stations. Each weather station collects meteorological data and produces summaries of the data. On request, it sends the summary information to an area computer. The area computer uses a database of digitized maps to generate a set of local weather maps.

6 CS 501 Spring 2005 Exam Question: Noun Identification A system generates weather maps using data collected from unattended weather stations. Each weather station collects meteorological data and produces summaries of the data. On request, it sends the summary information to an area computer. The area computer uses a database of digitized maps to generate a set of local weather maps.

7 CS 501 Spring 2005 Exam Question: Candidate Classes Systemgeneral term WeatherMap Datasame as MeteorologicalData WeatherStationis this a general term? MeteorologicalDatahow does this relate to WeatherStation? DataSummaryhow does this relate to MeteorologicalData? AreaComputerhardware Databasegeneral term DigitizedMap

8 CS 501 Spring 2005 Exam Question: Observations about the Candidate Classes WeatherMapis a DigitizedMap is derived from 1...* DataSummary WeatherStationhas a set of MeteorologicalData MeteorologicalData DataSummaryis derived from MeteorologicalData DigitizedMap Can Meteorological Data be an attribute of WeatherStation? Can DataSummary be combined with WeatherMap?

9 CS 501 Spring 2005 Exam Question: Attributes and Operations WeatherStation location metereologicalData collectData() getSummary() WeatherMap location date-time geographicData weather gatherData() printMap() DigitizedMap location geographicData printMap() Or should MetereologicalData be a separate object?

10 CS 501 Spring 2005 Exam Question: Class Diagram DigitizedMap 1...* 1 WeatherStation location metereologicalData collectData() getSummary() WeatherMap location date-time geographicData weather gatherData() printMap() summary

11 CS 501 Spring 2005 Modeling Dynamic Aspects of Systems Interaction diagrams: set of objects and their relationships including messages that may be dispatched among them Sequence diagrams: time ordering of messages Collaboration diagrams: structural organization of objects that send and receive messages Activity diagram: flow chart showing flow of control from activity to activity Statechart diagram: models a state machine

12 CS 501 Spring 2005 Notation: Statechart diagrams Waiting A state machine is a behavior that specifies the sequence of states an object or an interaction goes through during its lifetime in response to events. State diagrams can be used for both requirements specification and for program design.

13 CS 501 Spring 2005 State Diagram: Notation State diagram for class Book in a library system not borrowable returned() borrowable borrowed()[not last copy] borrowed()[last copy] guard expression

14 CS 501 Spring 2005 State Transition Diagram Patients Fields SetupReady Beam on Enter Start Stop Select field Select patient (lock on) (lock off)

15 CS 501 Spring 2005 Interaction: Bouncing Ball Diagrams Example: execution of Client Server(s) domain name service TCP connection HTTP get

16 CS 501 Spring 2005 Notation for Classes and Objects ClassesObjects AnyClass attribute1 attribute2 operation1() operation2() AnyClass or anObject:AnyClass :AnyClass anObject The names of objects are underlined. or

17 CS 501 Spring 2005 Notation: Active Class EventManager eventlist suspend() flush() An active class is a class whose objects own one or more processes or threads and therefore can initiate control activity.

18 CS 501 Spring 2005 Notation: Interaction display An interaction is a behavior that comprises a set of messages exchanged among a set of objects within a particular context to accomplish a specific purpose.

19 CS 501 Spring 2005 Actions on Objects call return send create destroy returnCopy(c) okToBorrow()local status notifyReturn(b)asynchronous signal > stereotypes

20 CS 501 Spring 2005 Sequence Diagram: Borrow Copy of a Book BookBorrower libMem: LibraryMember theCopy:Copy theBook:Book borrow(theCopy) okToBorrow borrow

21 CS 501 Spring 2005 Sequence Diagram: Change in Cornell Program Cornellian :MEngStudent 1 : getName() sequence numbers added to messages :PhDStudent 1.1 : name 2: > PhDStudent(name) 3: >

22 CS 501 Spring 2005 Sequence Diagram: Painting Mechanism :Thread:Toolkit:ComponentPeertarget:HelloWorld run callbackLoop handleExpose paint

23 CS 501 Spring 2005 Other Diagrams in UML Activity diagram is a statechart diagram that shows the flow from activity to activity within a system. Component diagram shows the organization and dependencies among a set of components. Deployment diagram shows the configuration of processing nodes and the components that live on them.

24 CS 501 Spring 2005 Activity Diagram (Flowchart) Release work order Assign tasksReschedule [materials not ready] [materials ready] guard expression branch Activity diagrams can be used for both requirements specification and for program design.

25 CS 501 Spring 2005 Activity Diagram: Parallel Activities DecompressStream audioStream video fork join start state stop state

26 CS 501 Spring 2005 Software Reuse Better software at lower cost Potential benefits of reuse: Reduce development time and cost Improved reliability of mature components Shared maintenance cost Potential disadvantages of reuse: Difficulty in finding appropriate components Components may be a poor fit for application The discussion of design for reuse draws from the book by Bruegge and Dutoit in the readings.

27 CS 501 Spring 2005 Software Reuse: Examples Software developers rely heavily on software components provided by others System software device drivers file systems exception handling network protocols Subsystems database management systems firewalls web servers

28 CS 501 Spring 2005 Software Reuse Examples (Tools) Standard functions mathematical methods formatting User interface toolkits (e.g. Quickdraw) class libraries, (e.g., Swing)

29 CS 501 Spring 2005 Software Reuse (Application Packages) An application package supports a standard application (e.g., payroll) Functionality can be enhanced by: => configuration parameters (e.g., table driven) => extensibility at defined interfaces => custom written source code extensions

30 CS 501 Spring 2005 Reuse and Object Oriented Languages Example: Java Java is a relatively straightforward language with a very rich set of class hierarchies. Java programs derive much of their functionality from standard classes Learning and understanding the classes is difficult Experienced Java programmers can write complex systems quickly Inexperienced Java programmers write inelegant and buggy programs

31 CS 501 Spring 2005 Design for Reuse The software design should anticipate possible changes in the system over its life-cycle. New vendor or new technology Components are replaced because a supplier goes out of business, ceases to provide adequate support, increases its price, etc., or because better software from another sources provides better functionality, support, pricing, etc. This can apply to either open-source or vendor-supplied components.

32 CS 501 Spring 2005 Design for Reuse New implementation The original implementation may be problematic, e.g., poor performance, inadequate back-up and recovery, difficult to trouble-shoot, or unable to support growth and new features added to the system. Example. The portal nsdl.org was originally implemented using uPortal. This did not support important extensions that were requested and proved awkward to maintain. It was reimplemented using PHP/MySQL.

33 CS 501 Spring 2005 Design for Reuse Additions to the requirements When a system goes into production, it is usual to reveal both weaknesses and opportunities for extra functionality and enhancement to the user interface design. For example, in a data-intensive system it is almost certain that there will be requests for extra reports and ways of viewing the data. Requests for enhancements are often the sign of a successful system. Clients recognize latent possibilities.

34 CS 501 Spring 2005 Design for Reuse Changes in the application domain Most application domains change continually, e.g., because of business opportunities, external changes (such as new laws), mergers and take-overs, new groups of users, etc., etc., It is rarely feasible to implement a completely new system when the application domain changes. Therefore existing systems must be modified. This may involve extensive restructuring.

35 CS 501 Spring 2005 Reuse Techniques Implementation inheritance: Reuse of code by subclassing an existing class and modifying its behavior. Specification inheritance: Subclasses are subtypes of their superclass. Objects of the subclass can be substituted for any object of the superclass type. Delegation: Implementation of an operation by sending a message to another class. *