4: Object-oriented Analysis & Design

Slides:



Advertisements
Similar presentations
9/10/2004Use Case Workshop 1 CSC480 Software Engineering Workshop 1 Requirements Modeling.
Advertisements

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
Requirements Analysis 2 What objects collaborate to achieve the goal of a use case?
UML exam advice. Minimal, yet sufficient UML course 80% of modeling can be done with 20% of the UML. Which 20% was that again? We’re supposed to be “Use.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Business Modeling Domain Modeling Source: Use Case Driven Object Modeling with UML – A Practical Approach By Doug Rosenberg ISBN:
Object-Oriented Analysis and Design
High-Level Design With Sequence Diagrams COMP314 (based on original slides by Mark Hall)
Detailed design – class design Domain Modeling SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
1 ITEC 3010 “Systems Analysis and Design, I” LECTURE 10: Use Case Realizations [Prof. Peter Khaiter]
Chapter 6 Use Cases. Use Cases: –Text stories Some “actor” using system to achieve a goal –Used to discover and record requirements –Serve as input to.
CSC 395 – Software Engineering Lecture 12: Reusability –or– Programming was Bjarne Again.
Software Life Cycle Requirements and problem analysis. –What exactly is this system supposed to do? Design –How will the system solve the problem? Coding.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
CS 4850: Senior Project Fall 2014 Object-Oriented Design.
A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.
Object Oriented Software Development
Design Model Lecture p6 T120B pavasario sem.
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
Use Case Textual Analysis
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Winter 2011SEG Chapter 11 Chapter 1 (Part 1) Review from previous courses Subject 1: The Software Development Process.
Object-Oriented Analysis and Design Use cases Finding classes Collaboration and Sequence diagrams Associations between classes.
Week 9, Day 2 Object-oriented Design Acknowledgement: These slides by Dr. Hasker SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
High Level Design Use Case Textual Analysis SE-2030 Dr. Mark L. Hornick 1.
What is this? SE-2030 Dr. Mark L. Hornick 1. Same images with different levels of detail SE-2030 Dr. Mark L. Hornick 2.
Engineering Quality Software Week02 J.N.Kotuba1 SYST Engineering Quality Software.
Auburn University COMP 2710 Software Construction Use Case Analysis – Examples and Exercises Dr. Xiao Qin Auburn University.
Slide design: Dr. Mark L. Hornick
An informal, team oriented, OO design system
Classes and their relationships
UML Diagrams: Class Diagrams The Static Analysis Model
Unified Modeling Language Tutorial
Chapter 9 Domain Models.
UNIT 1.
Module Road Map Refactoring Why Refactoring? Examples
Design Class Diagrams
Object-Oriented Analysis and Design
Chapter 16 UML Class Diagrams.
Chapter 5: Object Oriented Analysis and Design
Sequence Diagrams.
Sequence Diagrams.
Week 10: Object Modeling (1)Use Case Model
OO Domain Modeling With UML Class Diagrams and CRC Cards
MIS5101: Business Intelligence Relational Data Modeling
CIS 644 Tues. Sept. 7, 1999 blank.
OO Domain Modeling With UML Class Diagrams and CRC Cards
Object-Oriented Design
Sequence Diagrams.
CRC: Classes, Responsibilities, and Collaborations
3. Object-oriented Design
Overview of Eclipse Lectures
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Slides by Steve Armstrong LeTourneau University Longview, TX
Introduction to the Unified Modeling Language
Object oriented analysis and design
CIS 375 Bruce R. Maxim UM-Dearborn
Analysis models and design models
OOA&D II Bo Wang, Kan Qi Adapted from Alexey Tregubov’s Slides.
SE2811 Software Component Design Dr. Rob Hasker
Copyright 2007 Oxford Consulting, Ltd
Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract, Computer,
SE2811 Software Component Design Dr. Rob Hasker
Engineering Quality Software
12. Command Pattern SE2811 Software Component Design
11. MVC SE2811 Software Component Design
11. MVC SE2811 Software Component Design
Presentation transcript:

4: Object-oriented Analysis & Design SE2811 Software Component Design Dr. Rob Hasker 4: Object-oriented Analysis & Design

Building an OO system What is the process we have so far for building a system? Interview customers, collect stories/scenarios Identify nouns, verbs Remove duplicates, unnecessary classes (applying RIBS) Result: identified domain classes with attributes, operations High level/domain level class diagram: Meal wheel – see next page We will define “unnecessary” later!

Domain: Meal Wheel user stories As a hungry student, I want my phone to randomly select from different restaurants so I know where to eat. As a picky student, I want my phone to suggest close restaurants that serve sashimi so I can choose a place to eat within 10 minutes walk. As a restaurant owner, I want to distribute menus to potential customers. As a restaurant owner, I want potential customers to know of dietary restrictions that I support so I can attract customers who do not eat particular foods.

Identified nouns, verbs Student Phone Restaurant Sashimi Menu item Place location 10-minute walk distance Owner Menu Customer Dietary Restriction Verbs Select [restaurant] Eat [at restaurant] Serve [sashimi] Choose [a place to eat] Distribute [menus] Know [of dietary restrictions] Support [dietary restrictions] Attract [customers] Other objects: clear responsibilities – have students pick those out * Student: user; Restaurant: capture location; Place: a type of restaurant; owner: sets menu; Customer: user – better than student

As a hungry student, I want my phone to randomly select from different restaurants so I know where to eat. As a picky student, I want my phone to suggest close restaurants that serve sashimi so I can choose a place to eat within 10 minutes walk. As a restaurant owner, I want to distribute menus to potential customers. As a restaurant owner, I want potential customers to know of dietary restrictions that I support so I can attract customers who do not eat particular foods.

Selecting a restaurant Customer does something with phone, chooses a restaurant. Owner distributes menu. None of this makes sense

Refinements eating: out of scope menus may be distributed, but not by a direct act of the owner serving menu items is out of scope MealWheel knows about the customer; user just runs the app How they run it is an Android/iOS issue, out of scope for MealWheel

Selecting a restaurant Sequence has no scenario; what is a realistic one for selecting a restaurant? Identify restaurant items satisfying restrictions Present list Select restaurant

Add MealWheel App System is not a domain object, but useful MasterMenu: list all items Restaurant: does it have an item? How far away? But why notify the restaurant? No state change with operation

Note many new operations displayMenuItems displayRestaurantsWithItem Note many new operations AreaRestaraunts class: opportunity to restrict list by “close” restaurants displayRestaurantLocation

Note added restaurantsWithinDistance, etc Note added restaurantsWithinDistance, etc.; didn’t list operations on MealWheel, though could have. Note that each operation is in the TARGET class

General notes No dynamic relationships - capture things that don’t change during run Dynamic relationships rarely change interfaces Minimal directionality, few attribute/operation types; only where known No association labels – these clutter diagram and add little value beyond “x has y” Capture multiplicities! generally 1 or * 1..* usually not true at start, and 1..n (or i..n) is generally unnecessary detail. Don’t list getters, they are assumed, but could list setters Don’t list constructors; they can also be assumed at this point Type returned by distinctMenuItems is a bit vague; ok at high level

Next steps Refine, refine Questions to answer Important aspect of UML: can carry diagrams through whole project Each step: add more information Questions to answer What are the responsibilities for each class? Containers to use? Do any objects have complex states? If so, capture these! Capture additional scenarios as sequence diagrams Menu updates Setting dietary restriction; likely to discover need to support > 1 Are there opportunities for patterns? What maintenance problems can we anticipate? Are there classes with too many associations or operations?

Additional refinements Capture all setters, constructors; getters can be assumed Capture return, attribute, parameter types Generally: do not list private methods – those are particular to a developer’s implementation If specify enough detail, can auto-generate all code UML has sophisticated notation; can capture things like “object A is associated with only one of B or C” This can be more work than just writing the code… The win: can maintain the diagram, clients can provide more help In this case, probably will include private methods

Review Process: OOA&D: Object-oriented Analysis and Design Collect user stories, requirements, identify nouns and verbs Use RIBS to eliminate some, identify attributes Create initial class diagram Collect scenarios for use cases Draw high level sequence diagrams Construct domain-level class diagram(s) Refine class diagram, capturing containers and state diagrams Identify maintenance issues, apply patterns Create detailed diagram (“implementation level”) with all types, etc. Key in UML: can carry diagram through full process: analysis to design to implementation OOA&D: Object-oriented Analysis and Design I often don’t draw the detailed diagram – I can see this in the class diagram

Optional Exercise Campus door lock system with phone interface Can use app to provide user id information Alternatively: unlock with domain username, password Need mechanism to give/remove access for sections of students, individuals Auto lock, unlock at specified times of the day