This preview shows page 1-2-3-4-5-6-7-8-9-10-68-69-70-71-72-73-74-75-76-138-139-140-141-142-143-144-145-146-147 out of 147 pages.
Slide 12.1© The McGraw-Hill Companies, 2007Object-Oriented andClassical SoftwareEngineeringSeventh Edition, WCB/McGraw-Hill, 2007Stephen R. [email protected] 12.2© The McGraw-Hill Companies, 2007CHAPTER 12OBJECT-ORIENTEDANALYSISSlide 12.3© The McGraw-Hill Companies, 2007Overview The analysis workflow Extracting the entity classes Object-oriented analysis: The elevator problemcase study Functional modeling: The elevator problem casestudy Entity class modeling: The elevator problem casestudy Dynamic modeling: The elevator problem casestudy The test workflow: Object-oriented analysisSlide 12.4© The McGraw-Hill Companies, 2007Overview (contd) Extracting the boundary and control classes The initial functional model: The MSG Foundationcase study The initial class diagram: The MSG Foundationcase study The initial dynamic model: The MSG Foundationcase study Extracting the boundary classes: The MSGFoundation case study Extracting the boundary classes: The MSGFoundation case studySlide 12.5© The McGraw-Hill Companies, 2007Overview (contd) Refining the use cases: The MSG Foundationcase study Use-case realization: The MSG Foundation casestudy Incrementing the class diagram: The MSGFoundation case study The specification document in the Unified Process More on actors and use cases CASE tools for the object-oriented analysisworkflow Challenges of the object-oriented analysisworkflowSlide 12.6© The McGraw-Hill Companies, 2007Object-Oriented Analysis OOA is a semiformal analysis technique for theobject-oriented paradigmThere are over 60 equivalent techniquesToday, the Unified Process is the only viablealternative During this workflowThe classes are extracted RemarkThe Unified Process assumes knowledge of classextractionSlide 12.7© The McGraw-Hill Companies, 200712.1 The Analysis Workflow The analysis workflow has two aimsObtain a deeper understanding of the requirementsDescribe them in a way that will result in a maintainabledesign and implementationSlide 12.8© The McGraw-Hill Companies, 2007The Analysis Workflow (contd) There are three types of classes: Entity classes Boundary classes Control classesSlide 12.9© The McGraw-Hill Companies, 2007The Analysis Workflow (contd) Entity classModels long-lived information Examples: Account Class Investment ClassSlide 12.10© The McGraw-Hill Companies, 2007The Analysis Workflow (contd) Boundary classModels the interaction between the product and theenvironmentA boundary class is generally associated with input oroutput Examples: Investments Report Class Mortgages Report ClassSlide 12.11© The McGraw-Hill Companies, 2007The Analysis Workflow (contd) Control classModels complex computations and algorithms Example: Estimate Funds for Week ClassSlide 12.12© The McGraw-Hill Companies, 2007UML Notation for These Three Class Types Stereotypes (extensions of UML)Figure 12.1Slide 12.13© The McGraw-Hill Companies, 200712.2 Extracting the Entity Classes Perform the following three steps incrementallyand iterativelyFunctional modelingν Present scenarios of all the use cases (a scenario is an instanceof a use case)Class modelingν Determine the entity classes and their attributesν Determine the interrelationships and interactions between theentity classesν Present this information in the form of a class diagramDynamic modelingν Determine the operations performed by or to each entity classν Present this information in the form of a statechartSlide 12.14© The McGraw-Hill Companies, 200712.3 Object-Oriented Analysis: The Elevator Problem Case StudyA product is to be installed to control n elevators in a buildingwith m floors. The problem concerns the logic required tomove elevators between floors according to the followingconstraints:1. Each elevator has a set of m buttons, one for each floor.These illuminate when pressed and cause the elevator to visitthe corresponding floor. The illumination is canceled whenthe corresponding floor is visited by the elevator2. Each floor, except the first and the top floor, has twobuttons, one to request an up-elevator, one to request adown-elevator. These buttons illuminate when pressed. Theillumination is canceled when an elevator visits the floor, thenmoves in the desired direction3. If an elevator has no requests, it remains at its currentfloor with its doors closedSlide 12.15© The McGraw-Hill Companies, 200712.4 Functional Modeling: The Elevator Problem Case Study A use case describes the interaction betweenThe product, andThe actors (external users)Slide 12.16© The McGraw-Hill Companies, 2007Use Cases For the elevator problem, there are only twopossible use cases Press an Elevator Button, and Press a Floor ButtonFigure 12.2Slide 12.17© The McGraw-Hill Companies, 2007Scenarios A use case provides a generic description of theoverall functionality A scenario is an instance of a use case Sufficient scenarios need to be studied to get acomprehensive insight into the target productbeing modeledSlide 12.18© The McGraw-Hill Companies, 2007Normal Scenario: Elevator ProblemFigure 12.3Slide 12.19© The McGraw-Hill Companies, 2007Exception Scenario: Elevator ProblemFigure 12.4Slide 12.20© The McGraw-Hill Companies, 200712.5 Entity Class Modeling : The Elevator Problem Case Study Extract classes and their attributes Represent them using a UML diagram One alternative: Deduce the classes from use cases andtheir scenarios Possible danger: Often there are many scenarios, and hence Too many candidate classesν CST note: an early data dictionary may have been helpful here :-) Other alternatives: CRC cards (if you have domain knowledge, and you do!) Noun extractionSlide 12.21© The McGraw-Hill Companies, 200712.5.1 Noun Extraction A two-stage process Stage 1. Concise problem definitionDescribe the software product in single paragraphButtons in elevators and on the floors control themovement of n elevators in a building with m floors.Buttons illuminate when pressed to request the elevatorto stop at a specific floor; the illumination is canceledwhen the request has been satisfied. When an elevatorhas no requests, it remains at its current floor with itsdoors closedν This should be a paragraph in your SRS describing the productfunctionality, perfect it and see how well you can
View Full Document