1 / 28

MCS 270 Spring 2014

MCS 270 Spring 2014. Object-Oriented Software Development. MCS 270 Object-Oriented Software Development. Today ’ s schedule. Interaction Modeling: Use Case Model Sequence Model Activity Model Adapted from Software Engineering, Spring 2006, NYU

elijah
Download Presentation

MCS 270 Spring 2014

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MCS 270 Spring 2014 Object-Oriented Software Development

  2. MCS 270 Object-Oriented Software Development Today’s schedule Interaction Modeling: Use Case Model Sequence Model Activity Model Adapted from Software Engineering, Spring 2006, NYU http://cs.nyu.edu/courses/spring06/V22.0474-001

  3. MCS 270 Object-Oriented Software Development Unified modeling language (UML) • Class model: describes the static structure of objects and relationships in a system • Comprises object and class diagrams • State model:describes the dynamic aspects (life cycles) of objects and the nature of control in a system • Interaction model: describes how objects in a system interact to achieve broader results

  4. MCS 270 Object-Oriented Software Development Interaction Modeling: Use Cases • A use case names a type of user (actor) and something that they want to do (usecase). • An actor is an externaluser of a system. Can be a human, a device, or a piece of software. • The use case describes how an actor achieves a specific tangible goal.

  5. MCS 270 Object-Oriented Software Development Interaction Modeling: Use Cases • Usecase can consist of: • Textual Description: Name, Summary, Actors, Entry conditions, Exit conditions, Exceptions or Errors, Event-Flow Description • UseCase Diagram: Graphical (Brief!) summary of use case

  6. MCS 270 Object-Oriented Software Development Example: Use-Case Description • Name: Normal Subway Ride • Summary: A passenger takes a subway ride • Actors: Passenger • Entry Condition: Passenger at start station • Exit Condition: Passenger leaves end station • Exceptions: Out of tickets, Train in repair, Train Derail, Door won’t open, Miss stop station

  7. MCS 270 Object-Oriented Software Development Example: Use-Case Description Event-flow Description Passenger purchases ticket/has pre-purchased ticket Train arrives and stops at platform Doors open Passenger steps into train Doors close Passenger presses request button for final stop Doors open at final stop Passenger exits train

  8. Ride Repair MCS 270 Object-Oriented Software Development Example: Use Case Diagram Boundary for all use cases • Graph showing • Actors • Use cases • Edge: actor-case if that actor is involved in that case • Actors • Stick figures • Use cases • Ovals passenger technician

  9. MCS 270 Object-Oriented Software Development Exceptional Situations • Includerelationships • “Buy Ticket” use case is included in Ride use case. • Extend relationships • Expresses an exceptional variation of a use case • Normally used to express errors

  10. Buy Ticket Ride Repair Derail MCS 270 Object-Oriented Software Development <<include>> <<extend>> passenger technician

  11. MCS 270 Object-Oriented Software Development Summary of Use Cases • Use Case Diagram • Shows all actors, use cases, relationships • Actors are agents external to the system • Use Case Description – information for single Use case • Entry/Exit Conditions, Story, Main and Alternative Event flows, Exceptions • Specified in a separate document • Report style – complete sentences, etc

  12. MCS 270 Object-Oriented Software Development Interaction Modeling: Sequence Model • Sequences elaborate Use Cases - consist of: • Textual Scenario: Sequence of events occurring a specific event sequence in a system (could be a use case) • Sequence Diagram: Graphical summary of participants (Actors, Objects) and messages between participants through time

  13. MCS 270 Object-Oriented Software Development Sequence Diagram Sequence Diagram is a table Columns are classes or actors (lifelines) Rows are time steps (time flows from top to bottom) Horizontal Arrows show control/data flow Method calls Important changes in state Specific Diagram for each task

  14. Classes & Actors MCS 270 Object-Oriented Software Development Example Sequence Diagram Passenger Station Train buyTicket() arrives openDoors() closeDoors() pushButton(S)

  15. MCS 270 Object-Oriented Software Development Example Sequence Diagram Passenger Station Train Method Call Note: These are all synchronous method calls. There are other kinds of invocations. buyTicket() arrives openDoors() closeDoors() pushButton(S)

  16. MCS 270 Object-Oriented Software Development Example Sequence Diagram Passenger Station Train Invocation lifetime spans lifetimes of all nested invocations buyTicket() arrives openDoors() closeDoors() pushButton(S)

  17. Example Sequence Diagram Passenger Station Train “Lifelines” fill in time between invocations buyTicket() arrives openDoors() closeDoors() pushButton(S)

  18. MCS 270 Object-Oriented Software Development Interaction Modeling: Activity Model • Activity Model consists of: • Activity Diagram: Flow Chart of operations of application

  19. Activities in roundtangles buyTicket board MCS 270 Object-Oriented Software Development Example Activity Diagram Station Train trainArrive

  20. buyTicket board MCS 270 Object-Oriented Software Development Example Activity Diagram Station Train Fork trainArrive Concurrency Join

  21. buyTicket board MCS 270 Object-Oriented Software Development Example Activity Diagram Swim lanes show which classes/actors are responsible for which part of the diagram Station Train trainArrive

  22. Flow-chart if-then stopTrain announceNoStop MCS 270 Object-Oriented Software Development Example Activity Diagram StopRequested? yes no

  23. MCS 270 Object-Oriented Software Development Overview on Using UML: What’s Good A common language Makes it easier to share requirements, specs, designs Visual syntax is useful, to a point A picture is worth 1000 words For the non-programmer, easier to grasp simple diagrams than simple code/pseudo-code To the extent UML is precise, forces clarity Much better than natural language Commercial tool support Tools for UML -> code or vice-versa

  24. MCS 270 Object-Oriented Software Development Overview on Using UML: What’s Not so Good Hodge-podge of ideas Union of most popular modeling languages Visual syntax does not scale well Many details are hard to depict visually Ad hoc text attached to diagrams No visualization advantage for large diagrams 1000 pictures are very hard to understand Semantics is not completely clear Some parts of UML underspecified, inconsistent

  25. MCS 270 Object-Oriented Software Development Why use UML? UML is being widely adopted By users By tool vendors By programmers A step forward Better than just diving in and coding! First standard for high-levels of software process Expect further evolution, development of UML

  26. MCS 270 Object-Oriented Software Development Suggestions on using UML Discovering Requirements for Code Use Case Diagrams/Descriptions to illustrate use cases Activity or Sequence Diagrams to illustrate typical flow within a use case (scenarios) Design Class Diagram for system architecture

  27. MCS 270 Object-Oriented Software Development Use Case Exercise • Groups of 3-4: Create a Use Case analysis of “GusList” – an on-line classified ad service for the Gustavus community. • Ideal: Design use cases in conversation with users (Students, Faculty, Staff) • Next Best – You will practice this in conversation with each other. • Task: Identify • Actors • Use Case Names (General) • By next Tuesday, prepare (individually) a Requirements statement and a use case document. • Document contains: Requirements statement. Use Case diagram(s). At least two fully developed Textual Descriptions.

  28. MCS 270 Object-Oriented Software Development Assignments Friday – Read Chapters 10,11 Continue GusList Use Case Project Homework: Chapter 5. Exercises 5.3, 5.4 Programming: Interfaces Due Tomorrow: Friday, Feb. 21

More Related