31
Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or loosely coupled modules? What is the principle of Encapsulation? 6. Show the UML diagram for a class

Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Embed Size (px)

Citation preview

Page 1: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Quiz

1. Who is the guru of Extreme Programming?

2. who are the gurus of UML? 3. Do we want highly or lowly cohesive

modules? 4. Do we want strongly or loosely coupled

modules? What is the principle of Encapsulation? 6. Show the UML diagram for a class

Page 2: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Quiz Answers 1. Kent Beck 2. Jacobson, Booch, Rumbaugh (Three Amigos) 3. Highly cohesive 4. Loosely coupled 5. The implementation of a module should be

separated from its contractual interface and hidden from clients.

6.

Point

XY

move(dx, dy)+move(in dx : int, in dy : int) : void

-X : int-Y : int

Point

Page 3: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Unified Modeling Language

Page 4: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

UML Set of graphic notation techniques to create visual

models of software intensive systems Architectural blueprint of a software system Capture details about a system such that

the problem is clearly understood (design) solution architecture is developed a chosen implementation is clearly identified and

constructed Provides for ways to express complex relationships

among the basic building blocks Those relationships can be static or dynamic

Easier to communicate with non-professionals

Page 5: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Introduction Class diagrams

Shows the static relationships that exist among a group of classes and interfaces

Common relationships include inheritance (is-a), aggregation (part-of ), dependency and composition

Page 6: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Introduction Interaction diagrams

Used for modeling the dynamic behavior of a system

Two kinds of diagrams one of which are sequence diagrams (others fall under collaboration diagrams)

Used for modeling the message exchange between objects in a system (what do I mean message?)

Capture the relative time ordering of messages exchanges

Page 7: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Introduction Other

State chart diagrams Similar to finite state machines

Activity diagrams Components diagrams Deployment diagrams More than12 now

/cond

Page 8: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Cases Interactions between system and external

entities Users Other Systems

What the system does, not how things happen Specifies a sequence of actions, including

variants, that a system performs and that yields an observable result of value to a particular actor (Jacobson, Booch, Rumbaugh)

Page 9: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Cases

Set of scenarios (likely/possible occurrences) Main Scenario Alternative scenarios Exceptional scenarios

Sequence of interactions between actors/system

A little story that outlines some expected sequence of request and responses between actors and the system

Writing one is a like a game of “what happens next?”

Page 10: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Case

Main Scenario – Normal flow of events and outcomes “what will happen if all the preconditions are met”

Alternatives – also normal Exceptions – what if preconditions are not

met? Paragraph description of what happens

“A student registers in a class by logging in (if not logged in), selecting and open class, and saving the new schedule”

Page 11: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Case

User: A student Goal: registers in a class Scenario: by logging in, (if not logged

in), selecting and open class, and saving the new schedule

Page 12: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Online Shopping Example

Name: Validate credit card Actors: Customer, Credit card company Main Scenario:

1. Customer enters credit card number and expiration date

2. System verifies card with credit card company

3. System sends authorization message to customer

Page 13: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Online Shopping Example

Alternative 2a: If the credit card company rejects the card, system sends a rejection notice

Alternative 2b: If credit card company does not respond in 10 seconds, Tell the user of delay Repeat verifying the card

Alternative …

Page 14: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

General Guidelines

Use case must define a goal for its user Must be a “sunny day” scenario Make at an appropriate level

not too detailed (trivial, tedious - e.g. login as a separate use case)

not too high (vague) Don’t get technical (e.g. reference to

specific DB)

Page 15: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Case Diagrams Show use cases, actors and their

relationships Capture the precise requirements for the system

from a user’s perspective (not internal system)

Page 16: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Case Diagrams (UML) Consists of

Actors A person, organization, or external system that plays a role

in one or more interactions with your system Can make a service request to the system or be requested

to provide a service Drawn as stick figures

Use cases (each includes main scenario, alternatives, and exceptions)

Scenario Drawn as ovals

Page 17: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Case Diagrams (UML) Relationships among actors and use cases

Generalization relationships among actors Extends in Visio (change type to inherits) --- could be done in a

separate diagram Association relationships between actors and use cases

Communication in Visio Dependency relationships among use cases

Include (Uses in Visio) Access account includes login

Extends (i.e. special case of) (Extends in Visio) Open a dual account vs. open an account

Last two should be within the System boundary diagram

Page 18: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or
Page 19: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Sometimes “uses” instead “includes”

Page 20: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or
Page 21: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

University System

Students, faculty and admins Students: Login and get grades Faculty: Login, view student roster, & enter

grades for a student roster Admins: Login and verify grades

Page 22: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

System

Page 23: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or
Page 24: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or
Page 25: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Cases Every use case in the system must be explicitly

described Name Actors involved Preconditions Related Use Cases (Uses/Extends) Main Scenario Alternative Scenarios Exceptional Scenarios

Withdraw money from bank via ATM Wrong pin Balance not enough Money not removed in 60 seconds

Page 26: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Cases Steps

Extract actors and use cases Nouns that perform actions or respond to actions are actors Verbs or action nouns (registration, enrollment, etc …) are usually

use cases Draw use case diagram

Main uses cases and actors Don’t worry about completeness … will refine later on

Describe every use case Main scenarios

Refine use case diagram Add more relationships, secondary uses cases, secondary actors Complete

Refine use cases Alternative scenarios Complete

Iterative development process

Page 27: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

E-Book Store Allows customers to search and shop for books,

music CDs, and computer software on the Web

Provides information about the titles it carries to help customers make purchases

Other functionalities Customer registration (needed for shopping only) – first

time only, login henceforth (needed for shopping only) Support management of the system such as adding,

deleting and updating titles (Catalog manager) Updating customer account information & processing

orders (Customer manager) Manage inventory (Inventory manager) – e.g., order

products

Page 28: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

E-Book Store Actors:

Customer Manager

Inventory Catalog Customer

Use Cases: Register Login Search/Browse Shop Manage Inventory Manage Catalog Manage Accounts Manage Orders

Page 29: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

E-Book Store

Customer

Customer Manager

User

Catalog Manager

Inventory Manager

«inherits»

«inherits»

Register

Shop/Buy

Manage Accounts

Login

Manage Catalog

Manage Inventory

«uses»

«uses»

«uses»

«uses»

Browse/Search

* *

«uses»

«inherits»

«inherits»

Manage Orders

«uses»

Page 30: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Case: Shop Name: Shop Primary Actor:

Customer Uses/Extends: Uses

Browse & Login Precondition:

Customer already registered

Customer System

1-Customer searches (Browse)

2-Show info on selected titles

3-Customer selects a title to buy

4-Add to shopping cart

Repeat steps 1 thru 4 as need

5-Done shopping and check out

6-Request customer ID and password

7-Customer enters customer ID and password (Login) (first time only)

8-Authenticate customer & Authentication succeeds 9-Display contents of shopping cart10-Request shipping address11-Request payment method and billing address

12-Customer confirms order, shipping address, payment method and billing address

13-Validate payment method & Validation Succeeds 14-Process order, issue receipt and notify warehouse

Page 31: Quiz 1. Who is the guru of Extreme Programming? 2. who are the gurus of UML? 3. Do we want highly or lowly cohesive modules? 4. Do we want strongly or

Use Case: Shop Alternative Scenario 1

Customer authentication fails repeat login procedure (warn user and go back to step 6)

Alternative Scenario 2 Payment validation fails prompt the

customer for new payment information (warn user and go back to step 11)

Exceptional Scenario Customer leaves without checking out

Save shopping cart for 48 hours