CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)

Slides:



Advertisements
Similar presentations
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Advertisements

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Systems Analysis and Design 8th Edition
Ch 12: Object-Oriented Analysis
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Object-Oriented Analysis and Design
Introduction To System Analysis and Design
Systems Analysis and Design in a Changing World, Fourth Edition
Slide 6B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Essentials of class models. 2 A very simple class model In UML, a class is shown in a class diagram as a rectangle giving its name.
1 Objectives To introduces the concept of software Design. To introduce the concept of Object- Oriented Design (OOD). To Define various aspects about object.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Slide 6A.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
CSC 395 – Software Engineering Lecture 15: Object-Oriented Design –or– Ask For Whom The Data Tolls.
Slide 12C.50 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005.
Case Study: Class Extraction.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Unified Modeling Language
Business Modeling Domain Modeling Source: Use Case Driven Object Modeling with UML – A Practical Approach By Doug Rosenberg ISBN:
CSC 213 – Large Scale Programming. Today’s Goal  Learn Unified Process to design programs  Understand what are the “types” of Java classes  Methods.
Objects What are Objects Observations
Lecture 2: UML Class DIAGRAM
OBJECT-ORIENTED ANALYSIS PHASE
Slide 12.1 © The McGraw-Hill Companies, CS 4310: Software Engineering Lecture 7 Systems Analysis Object-Oriented Design.
Data Flow Diagrams.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
System models Abstract descriptions of systems whose requirements are being analysed Abstract descriptions of systems whose requirements are being analysed.
CSC 213 – Large Scale Programming Lecture 2: Object-Oriented Analysis & Object-Oriented Design.
CSC 213 – Large Scale Programming Lecture 3: Object-Oriented Analysis.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Systems Analysis and Design in a Changing World, Fifth Edition
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
CS3320::CH111 OBJECT-ORIENTED ANALYSIS Chapter 11.
1 Analysis Extracting from Use Cases to Create Diagrams.
Lecture 14 & 15: Object- Oriented Analysis Anita S. Malik Adapted from Schach (2004) Chapter 12.
CSC 213 – Large Scale Programming. Today’s Goal  Improve design skills to make usable designs  Noun extraction & UML class diagram reviewed  Connections.
Systems Analysis and Design in a Changing World, 3rd Edition
Systems Analysis & Design 7 th Edition Chapter 5.
Systems Analysis and Design 8 th Edition Chapter 6 Object Modeling.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
CSC 395 – Software Engineering Lecture 14: Object-Oriented Analysis –or– Ripping the Band-Aid Off Quickly.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
An Introduction to the Unified Modeling Language
Lecture 6: Structural Modeling
Slide 12A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
Slide 12.1 Object-Oriented and Classical Software Engineering Chapter 12 Object Oriented Analysis.
Design Jon Walker. More UML ● What is UML again?
Petri Nets Invented by Carl Adam Petri in 1962 Concurrent systems with timing problems  Synchronization, race problem, deadlock A petri net consists of.
CSE 403, Spring 2008, Alverson Using UML to express Software Architecture.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
THE ANALYSIS WORKFLOW  The specification document  Informal specifications  The analysis workflow  Extracting the entity classes  Functional modeling:
Slide 12.1 © The McGraw-Hill Companies, 2007 Object-Oriented and Classical Software Engineering Seventh Edition, WCB/McGraw-Hill, 2007 Stephen R. Schach.
CHAPTER 13 OBJECT-ORIENTED ANALYSIS. Overview l The analysis workflow l Extracting the entity classes l The elevator problem case study l The test workflow:
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
Use Case Textual Analysis
Software Engineering Zhang Shuang
Systems Analysis and Design in a Changing World, Fourth Edition
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
CHAPTER 12 OBJECT-ORIENTED ANALYSIS. Overview Extracting the entity classes Object-oriented analysis: The elevator problem case study Functional modeling.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
CSCI 383 Object-Oriented Programming & Design Lecture 7 Martin van Bommel.
High Level Design Use Case Textual Analysis SE-2030 Dr. Mark L. Hornick 1.
Lecture 9: Birds + BEES = CLASSES?
The Movement To Objects
Introduction to Unified Modeling Language (UML)
Business System Development
Object-Oriented Analysis
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)

Today’s Goal Begin discussion OO analysis How do we transition from requirements to code? What can we do to help create reusable designs? Ways to check our analysis How UML helps express these ideas

Analysis Workflow Translate project to software engineering terms Begins with use-cases and textual descriptions End with a highest-level modules (classes), what each modules must do, and how they may interact Workflow accomplishes this in two ways: 1. Obtain deeper understanding of the requirements 2. Describe requirements in manner resulting in maintainable design & implementation For unified process, this is use case driven Everything begins with the use cases

3 “Types” of Classes Unified Process concept to simplify designs Entity classes hold the long-lived data Boundary classes performs the input & output Control classes do complex processing and actions “Types” exist only for purposes of design Need UML stereotypes to display them

Iteratively Extract Classes 1. Functional modeling Present scenarios of use cases 2. Class modeling Find entity classes and their attributes Determine their interrelationships and interactions Show this information using UML class diagrams 3. Dynamic modeling Determine operations for entity class Display information using UML statechart

Scenarios Use case provides generic description of functionality Scenario scripts one instance of the use case Provides idea of how use case could play out Study more than one scenario per use case Need comprehensive insight into target product Examining multiple situations reduces chance that rare condition is overlooked Details skipped here cause impossible-to-find errors later

Normal Scenario: Elevators

Exception Scenario: Elevators

Entity Class Modeling Extract classes and their attributes Represent them using a UML class diagram Diagram enables deducing class properties Enables early refinement of class design Try deducing from use cases and scenarios Risks finding too many candidate classes Instead use domain knowledge via CRC cards or play English major and use noun extraction But remember, these find candidate classes

Noun Extraction Initially finds entity class candidates Not all entity classes will be found during initial pass Some classes in early passes will not be used Also provides really good hints as to other classes Identify nouns in requirements Eliminate classes external to the problem Ignore abstract (non-physical) nouns and those for communication

Boundary Classes Perform system’s inputs & outputs Inputs and outputs are often complex Each input & output combine many details Each detail may need own boundary class Go from simplest classes to complex class Combining simple classes is easy Breaking up complex classes is much harder Boundary classes may duplicate primitive type, could skip defining these classes Instead hard-code primitive everywhere Change by finding and replacing all related code

Control Classes Defined for non-obvious algorithms using multiple items Rule of thumb: algorithm is non-obvious if it does not have a name Includes all plural nouns in requirements If exact number known, use an array Otherwise need Collection class

Buttons in elevators and on the floors control the movement of n elevators in a building with m floors. Buttons illuminate when pressed to request the elevator stop at a specific floor; the illumination is canceled when the request has been satisfied. When an elevator has no requests, it remains at its current floor with its doors closed. Entity ClassBoundary Class Control Class External Classes (ignored) Elevator Controller

UML Class Diagrams Classes drawn as a 3-part box Class name written in top portion of box Attributes (fields) written in middle portion of box Operations (methods) written in bottom portion

Connection Between Classes Relationships shown via connecting lines Line & its marks denotes “type” of relationship Multiplicity – numbers in relationship – labeled Advanced multiplicity relationships possible * used when relationship involves 0 or more + used when relationship involves 1 or more “1..4” when relationship may need 1 to 4 instances

Connection Between Classes Examples of relationships Aggregation Car aggregates Chassis, Engine, Wheel… Composition Chessboard is composition of Squares Association Object calls methods in other object, but does not contain fields Generalization (“inheritance”)

UML Class Diagram for Elevator Controller Button objects currently serves two purposes Buttons in elevator directing travel to a floor Buttons on a floor requesting travel Solution: Make 2 specializations of Button

UML Class Diagram for Elevator Controller n to m communication is bad This is hard to impossible to code Add classes to simplify this process

UML Class Diagram for Elevator Controller

CRC Card Good for use with explicit knowledge domain Excellent for testing class design Create card for each class List Class, Responsibilities, & Collaborations Responsibilities list actions class performs Collaboration lists associated classes Responsibilities should either be Change state of the current class Send message (e.g., call method) of class whose state changes

CRC Card Example

Dynamic Modeling Dynamic modeling is 3 rd step in extraction Constructs statechart showing software operation Operations determined from the scenarios State diagrams (aka, event flow) rely on meaningful symbols Solid circle represents initial state White circle containing small black circle is final state Other states use rectangles with rounded corners Arrows represent possible state transitions

Dynamic Model: Example

For Next Lecture Complete discussion OO analysis Developing sequence & collaboration diagrams to refine use cases Give you chance to practice all these ideas