More on Class Diagrams. Visibility Both attributes’ and methods’ visibility can be defined in the class diagram: + public/derived - privateunderlinedstatic.

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design Evolutionary Requirements.
Advertisements

Use Case & Use Case Diagram
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
Writing Use Cases: Requirements in Context
Use cases.
Information System Engineering
January Ron McFadyen1 Use Cases in the UML Functionality under consideration is represented by use cases (named ellipses) enclosed in a box.
Conversation Form l One path through a use case that emphasizes interactions between an actor and the system l Can show optional and repeated actions l.
Jan Ron McFadyen1 Use Cases in the UML Functionality under consideration is represented by use cases (named ellipses) enclosed in a box Actors.
COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6.
Use-case Modeling.
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” - may be of.
Fall 2009ACS-3913 Ron McFadyen1 Use Cases Used to capture functional requirements – there are other requirements categories such as usability, reliability,
Diagram Notations
Use Cases & Requirements Analysis By: Mostafa Elbarbary.
Understanding Requirements
© 2005 Prentice Hall4-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Copyright ©2004 Cezary Z Janikow 1 Use Cases n Within Requirements discipline/workflow n Verbal descriptions of important functional (behavioral, transactional,
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 More on use cases System sequence.
This section has been adapted from Dr. Scott Fleming of U. Memphis Details about Use Cases.
The Unified Modeling Language (UML) Class Diagrams.
The first step in getting what you want is to decide what you want.
Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative Development Part III Elaboration Iteration I – Basic1.
® IBM Software Group © 2006 IBM Corporation Writing Good Use Cases Module 4: Detailing a Use Case.
Software Engineering 1 Object-oriented Analysis and Design Chap 30 Relating Use Cases.
Object-Oriented Analysis and Design
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Developing Use Cases in a Group Carolyn L. Cukierman Face-to-Face Technology Conference March 27, 2000.
Systems Analysis and Design in a Changing World, 6th Edition
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.
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Writing Use Cases: Requirements in Context.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 20. Review Software Requirements Requirements Engineering Process.
Object-Oriented Analysis and Design Jan 14, 2009.
 Development is organized in a series of short, fixed-length mini-projects called iterations  Iterations are also incremental  Successive enlargement.
Faculty of Computer & Information
OOSE Use Case. Requirement Functional: –Features, capabilities, and security Non Functional: –Usability: Human factors, help, and documentation –Reliability:
Chapter 9 Applying UML and Patterns -Craig Larman
Requirements Analysis and Design Engineering Southern Methodist University CSE 7313.
1 Object-Oriented Modeling Using UML CS 3331 Section 2.4 Modeling Requirements with Use Cases.
1 Structuring Systems Requirements Use Case Description and Diagrams.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
OO Methodology Inception Phase.
Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system.
Adv. Use cases Actor generalization – general and special actors Use case generalization – general and special use cases Include and extend relationships.
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 5 INTRODUCTION TO SYSTEMS ANALYSIS AND DESIGN: AN AGILE, ITERATIVE APPROACH CHAPTER.
CS212: Object Oriented Analysis and Design Lecture 32: Use case and Class diagrams.
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” Used to capture and describe.
PRESENTATION ON USE CASE. Use Case Modeling Use case diagrams describe what a system does from the standpoint of an external observer. The emphasis is.
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Writing Use Cases: Requirements in Context.
Understanding Requirements
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
UML - Development Process 1 Software Development Process Using UML.
Larman chapter 61 Use cases Larman chapter 6. 2 Fig. 6.1.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
Use Case Diagrams. Introduction In the previous Lecture, you saw a brief review of the nine UML diagrams. Now that you have the clear, you'll start to.
Requirements capture: Using UML Use Cases David Millard and Yvonne Howard {dem,
Jan Ron McFadyen1 Use Cases Used to capture functional requirements – there are other requirements categories such as usability, reliability,
Use Cases Discuss the what and how of use cases: Basics Examples Benefits Parts Stages Guidelines.
CMPE 280 Web UI Design and Development August 29 Class Meeting
Systems Analysis and Design in a Changing World, 6th Edition
System Sequence Diagrams and Operation Contracts
UML Use Case Diagrams.
Writing Use Cases.
Systems Analysis and Design in a Changing World, 6th Edition
Relating Use Cases popo.
Using Use Case Diagrams
Software Requirements
Use cases Dr. X.
Presentation transcript:

More on Class Diagrams

Visibility Both attributes’ and methods’ visibility can be defined in the class diagram: + public/derived - privateunderlinedstatic # protected Repression tweet + user + when (datetime) + text (string) Ex: All three of these attributes are public

Associations A solid line represents an association and contains: – A unary or binary link – Cardinality – A name defining the association – Can be also adorned with role names, ownership, visibility and other properties Associations exist when one class is an attribute of another User + username: String + tweets: Tweet[] Repression tweet + user: id + when: datetime + text: String 1 * tweets

Specific Associations Aggregations – “has a” relationships – Occurs when a class is a container of other classes – However, this is not imply ownership, (ie. when the “parent” gets destroyed, the aggregates do not) – Ex: A class has professors, but if the class is cancelled, the professors do not disappear Class + courseNumber: String Professor + name: String 1 * teaches

Specific Associations Composition – combining simple objects into a more complex whole – Can have multiple objects compose into one – Implies an “owns a” relationship – If the parent is destroyed, all its composites typically are also destroyed – Ex: Demolishing a building destroys its floors Floor + floorNumber: int Building + address: String 1 1..* contains

Difference between Composition and Aggregation Composition: – Composed of multiple parts – Parts have no independent existence – The structured whole makes the object Aggregation: – Does not imply ownership – Parts have independent existence – May be called a composition if the distinction is not important

Generalization/Specialization Generalization: – “is a parent” – Repression view is a generalization of RSS View Specialization – “is a child” – Google map view is a specialization of Repression view Repression view + reports Google map view + JavaScript RSS View + XML text

Realization (Implementation) Relationship where one class (the client) implements another (the supplier) Represented with a dashed line from the implemented class to the implementation Building + address: String Blueprint + address: String

Dependencies Occur when – a client class depends on another because it uses it (supplier) at some point in time Common when the client class: – Uses a supplier class that has global scope – Uses a supplier class as a parameter – Uses a supplier class as a local variable – Sends a message to the supplier Note the difference between this and associations Client Supplier

A more complete Class/Object Class/Object Name Attributes Methods/Operations Bank Account - owner: String - balance: Dollars + getBalance() : Dollars A class name should be descriptive (Italic if abstract) The attributes of a class defines its properties, what data the class stores The methods/operations of a class specify what the class does

UML Examples Note we will not be getting into this level of detail until HW 4 I’m presenting it now as part of the diagram section For HW1, I only expected you to use what we did in previous lectures For HW 2, I want you to think about adding some of the new relationships we discussed, but remember that we are still not designing the program’s structure

Source: bigelow.ch

More on Use-Cases We’ll go into more detail about – How to create a more formal use-case – Guidelines for creating use-cases – This section has been adapted from Dr. Scott Fleming of U. Memphis

What are “fully dressed” use cases? All steps and variations written in detail Structured template – Tend toward the formal – However, rough sketching can be useful

“Fully dressed” UC template UC name Scope Level Primary actor Stakeholders and interests Preconditions Success guarantees Main success scenario Extensions (or alternative flows) Special requirements Technology and data variations list Frequency of occurrence Miscellaneous

UC name Start with a verb Examples: – Process Sale – Handle Returns

Scope Will always be the software system under development for us Example: – NextGen POS application There also business use cases, but we don’t care about them in this class

Level Two levels that we care about: User-goal level: describes scenarios that fulfill the goals of the primary actor – Most common Subfunction level: describes substeps to support a user goal – Used to factor out common text from other UCs

Primary actor Principal actor that calls upon system services to fulfill a goal – Usually human, but not always

Stakeholders and interests list “The [system] operates a contract between stakeholders, with the use cases detailing the behavioral parts of that contract… The use case, as the contract of behavior, captures all and only the behaviors related to satisfying the stakeholders’ interests” –Cockburn (2001) Example stakeholders and interests: – Cashier: Wants accurate, fast entry and no payment errors, as cash drawer shortages are deducted from his/her salary. – Salesperson: Wants sales commission updated.

Stakeholders and interests list “The [system] operates a contract between stakeholders, with the use cases detailing the behavioral parts of that contract… The use case, as the contract of behavior, captures all and only the behaviors related to satisfying the stakeholders’ interests” –Cockburn (2001) Example stakeholders and interests: – Cashier: Wants accurate, fast entry and no payment errors, as cash drawer shortages are deducted from his/her salary. – Salesperson: Wants sales commission updated. Note: Explains why

Preconditions Things that must always be true be the scenario begins – May imply completion of another UC’s scenario Examples: – User has logged in – Cashier is identified and authenticated Skip uninteresting or obvious preconditions – Anti-example: User is alive – Anti-example: Computer is plugged in

Success guarantees (postconditions) Things that must be true after the success scenario or some alternative path – Should meet the needs of all stakeholders Example: – Sale is saved. Tax is correctly calculated. Accounting and Inventory are updated. Commissions recorded. Receipt is generated.

Main success scenario Sequence of steps in a scenario of a successful typical use of the system Three types of steps: – Interaction between actors – Validation (usually by system) – State change of system (e.g., recording or modifying something) – (Additionally, step 1 may indicate a trigger event) Defer conditionals to Extensions section Idiom: capitalize actors names

Extensions (or alternative flows) All other scenarios and branches – May end in success or failure Example: – 3a. Invalid item ID (not found in system): 1. System signals error and rejects entry. 2. Cashier responds to error… – 3b. Multiple of same item… Guideline: write conditions as something that can be detected by system or actor

Extensions (cont’d) All other scenarios and branches – May end in success or failure Example: – 3a. Invalid item ID (not found in system): 1. System signals error and rejects entry. 2. Cashier responds to error… – 3b. Multiple of same item… Guideline: write conditions as something that can be detected by system or actor Alt. condition resulting from main success step 3 Resulting steps Another alt. condition resulting from main success step 3

Extensions (cont’d) At end, the extension merges back with the main success scenario unless the extension indicates otherwise Complex extensions might be better expressed as a separate UC Example: a condition that is possible during any step of the main scenario: – *a. System crashes… Example: branching to another use case: – 2c. Cashier performs Find Product Help to obtain…

Special requirements Non-functional requirements relevant to the UC – I.e., URPS+ requirements Examples: – Touch screen UI on a large flat panel monitor. Text must be visible from 1 meter. – Credit authorization response within 30 seconds 90% of the time – Language internationalization on the text displayed. – Pluggable business rules to be insertable at steps 2 and 6.

Technology and data variations list Constraints on how to build the system – Typically imposed by the customer Examples (reference relevant steps): – 3a. Item identifier entered by laser scanner or keyboard – 3b. Item identifier may be any UPC, EAN, JAN, or SKU coding scheme – 7a. Credit account information entered by card reader or keyboard – 7b. Credit payment signature captured on paper receipt. But within two years, we predict many customers will want digital signature capture

Whew! That’s a lot to remember

How could creating “fully dressed” use cases be useful? (Why write them?)

How could creating “fully dressed” use cases be useful? Aid for thinking through what to build Help with detailed planning Reveal other use cases ? Documenting requirements ? ? Communicating with customer ? Project-specific costs/benefits very important to consider!

When do you think you should write “fully dressed” use cases?

After many brief/casual UCs have been identified Larman says “10% of the critical use cases would be written this way during the first requirements workshop” Not long before you implement Possibly never depending on the type of project If you write them all at the beginning, you’re doing waterfall!

Now let’s discuss some guidelines to help you write better, more useful UCs

Consider this motivating example At requirements workshop, a cashier says he needs to “log in to the system” Is he making assumptions about the solution? How might that limit you, as the designer? How can you prevent customers from accidentally imposing unnecessary requirements?

Guideline: Write in essential style Express narrative at level of – user’s intentions and – system’s responsibilities Avoid UI details!!

What is wrong with this example? 1.Administrator enters ID and password in dialog box. 2.System authenticates Administrator 3.System displays the “edit users” window

What is wrong with this example? 1.Administrator enters ID and password in dialog box. 2.System authenticates Administrator 3.System displays the “edit users” window Limits possible designs by specifying UI

Here’s an essential-style example 1.Administrator identifies self. 2.System authenticates identity. This version leaves open novel solutions such as biometric readers that the other version precluded

Here’s another motivating example Consider a UC step that says “The system generates a SQL INSERT statement for the sale…” What assumptions does the UC make? How might those assumptions limit you? How can you prevent customers from accidentally imposing these sorts of unnecessary requirements?

Guideline: Use black-box style Do not describe internal workings of system Say what the system does, not how it does it Think of system in terms of its responsibilities

How might you word this step using black box? The system generates a SQL INSERT statement for the sale…

How might you word this step using black box? The system generates a SQL INSERT statement for the sale… Like this: The system records the sale.

Consider this motivating quote “the software industry is littered with failed projects that did not deliver what people really needed” — Larman How can we make sure we deliver what our customers really need?

Guideline: Actor and actor-goal perspective Write requirements focusing on the users (actors) of a system, asking about their goals and typical situations – Look for different types of users Focus on understanding what the actor considers a valuable result

We know that the customers have difficulty effectively communicating requirements How can we discover requirements that the customer might not think to tell us about?

Guideline for finding requirements Ask probing questions that focus on: The system boundary The primary actors and their goals

The System Mobile/web customer Such probing might produce a helpful diagram like this Phone system Phone support Service tech Phone customer Bicycle stations

What’s Next For You? HW 2 is available online – Get together and get started on it early Due to some students dropping, we may need to modify some teams