chapter 5 analysis model. analysis model (am) the first step in describing how the system will...

30
Chapter 5 Analysis Chapter 5 Analysis Model Model

Upload: janis-palmer

Post on 27-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Chapter 5 Analysis ModelChapter 5 Analysis Model

Analysis model (AM)Analysis model (AM)The first step in describing The first step in describing howhow the the

system will implement the requirements system will implement the requirements specificationspecification

Input artifacts:Input artifacts:Detailed use casesDetailed use casesUse case modelUse case modelUser experience modelUser experience modelBusiness entities modelBusiness entities model

AM StructureAM Structure Key Abstraction folderKey Abstraction folder

For each business packageFor each business packageBoundary classesBoundary classesControl classesControl classesEntity classesEntity classes

External SystemsExternal Systems Managed entities for the whole systemManaged entities for the whole system

Use Case Realization folderUse Case Realization folder For each business packageFor each business package

For each use caseFor each use case A VOPC diagramA VOPC diagram For each major flow of the use caseFor each major flow of the use case

A sequence diagramA sequence diagram

Analysis Model StructureAnalysis Model Structure

Figure 5-1

Model StructureModel Structure

Analysis Model

Key Abstractions Use Case Realization

Business package1

Business package2

External SystemBusiness package

1Business package

2

Boundary

Control

Entity

Managed entities

Use case 1

Use case i

Use case 1

Use case j

Use case M Use case N

Tracing use case realizations to Tracing use case realizations to use cases & Ux storyboardsuse cases & Ux storyboards

Figure 5-2

AM: Key abstractionsAM: Key abstractions Boundary classesBoundary classes

Model the interaction of the system with its actorsModel the interaction of the system with its actors For human actors – maps to web pages/HTML formsFor human actors – maps to web pages/HTML forms For external systems – maps to adaptersFor external systems – maps to adapters

Control classesControl classes Capture the control logic (presentation and business Capture the control logic (presentation and business

logic) of one or more use caseslogic) of one or more use cases Entity classesEntity classes

Represent the business concepts manipulated by Represent the business concepts manipulated by the systemthe system

No attributes or operations are specified for key No attributes or operations are specified for key abstraction classes in analysis modelabstraction classes in analysis model

Boundary, Control, & EntityBoundary, Control, & Entity

Figure 5-3

AM: Boundary classesAM: Boundary classes Model the interaction of the system with its actors Model the interaction of the system with its actors

(Human actors and External systems)(Human actors and External systems) Actors only interact with boundary classesActors only interact with boundary classes Boundary classes may interact with other boundary Boundary classes may interact with other boundary

classes, actors, and control classesclasses, actors, and control classes Create a boundary class for each screen in the user Create a boundary class for each screen in the user

experience model – one-to-one relationship between experience model – one-to-one relationship between boundary classes and the screensboundary classes and the screens

Create a boundary class for each external systemCreate a boundary class for each external system No boundary class for input formsNo boundary class for input forms

Tracing boundary classes to screens for Tracing boundary classes to screens for the User Account Management packagethe User Account Management package

Figure 5-4

Use case model: The Create Use case model: The Create Account use case perspectiveAccount use case perspective

Figure 5-11

Boundary class for credit card Boundary class for credit card external systemexternal system

Credit Card System(Adapter)Credit Card System

(External)

AM: Control classes - 1AM: Control classes - 1 Capture the control logic of one or more use casesCapture the control logic of one or more use cases Presentation logicPresentation logic

Dispatcher –control the flow of execution for a specific use –control the flow of execution for a specific use casecase

Its responsibilities are assigned based on the analysis of the Its responsibilities are assigned based on the analysis of the flow of events in the use caseflow of events in the use case

Business logicBusiness logic Entity manager – control the access to one or more related – control the access to one or more related

entity classes for a specific use case package, defining a entity classes for a specific use case package, defining a business interface to those classes.business interface to those classes.

Its responsibilities are assigned based on what entities are Its responsibilities are assigned based on what entities are involved in the use case and what their roles are.involved in the use case and what their roles are.

AM: Control classes - 2AM: Control classes - 2 Dispatcher classes: Dispatcher classes:

Define a dispatcher control class for each use case Define a dispatcher control class for each use case e.g., e.g., CreateAccountDispatcherCreateAccountDispatcher for the for the

Create_Account use caseCreate_Account use case

Entity Manager classes: Entity Manager classes: Create an entity manager control class for each use Create an entity manager control class for each use

case case package.. e.g., e.g., AccountManagerAccountManager for the Account_Management for the Account_Management

use case package use case package

Merge dispatcher control classes as Merge dispatcher control classes as appropriate.appropriate.

Associations between control classes in Associations between control classes in the User Account Management packagethe User Account Management package

Figure 5-5

AM: Entity classes - 1AM: Entity classes - 1 Represent the business concepts manipulated by the Represent the business concepts manipulated by the

systemsystem Normally entity classes belong to the whole system -- Normally entity classes belong to the whole system --

enterprise. enterprise. The basis for the logical design of the databaseThe basis for the logical design of the database All communication to entity classes should go through an All communication to entity classes should go through an

entity managerentity manager Derive entity classes from the business entity modelDerive entity classes from the business entity model Package entity managers are responsible for the Package entity managers are responsible for the

management of the entities identified for the use cases in management of the entities identified for the use cases in the package. (e.g., the package. (e.g., AccountManagerAccountManager is responsible for is responsible for CreditCardCreditCard, , UserAccountUserAccount and and UserGroupUserGroup entity classes entity classes for the UserAccountManagement use case package)for the UserAccountManagement use case package)

AM: Entity classes - 2AM: Entity classes - 2How to identify entity classesHow to identify entity classes

Noun identification technique:Noun identification technique: For each use case, underline nouns and noun phrasesFor each use case, underline nouns and noun phrases Eliminate duplicates and unsuitable ones to have a draft of Eliminate duplicates and unsuitable ones to have a draft of

the class listthe class list

ExampleExample: : USE CASE: USE CASE: A student selects a course and registers in one

of its sections provided the student meets all the prerequisites of the course. A professor may select a section of a course to teach and obtain a student list for the

section. Identified ClassesIdentified Classes: : student, course, section, and

professor

AM: Entity classes - 3AM: Entity classes - 3Three types of associations between Three types of associations between

entity classes:entity classes:Unspecified association: for classes : for classes

managed by two separate managersmanaged by two separate managersAggregation associations: one class is part of : one class is part of

another and the part class may belong to another and the part class may belong to more than one aggregatemore than one aggregate

Composition associations: like aggregation, : like aggregation, but part classes cannot belong to other but part classes cannot belong to other classes, the parts live and die with the whole.classes, the parts live and die with the whole.

Entity model for the User Account Entity model for the User Account Management packageManagement package

Figure 5-7

Managed Entities diagramManaged Entities diagram

Figure 5-8

AM: Managed entities diagramAM: Managed entities diagram

Shows the manager of each package and the entities Shows the manager of each package and the entities managed by each manager and the relationship between managed by each manager and the relationship between entitiesentities

StudentManager

StudentMajor

CatalogManager

SectionCourse

FacultyManager

DepartmentFaculty

Note: For simplicity, cardinality ratios are not shown here.

AM: Relationship between classesAM: Relationship between classes

section

course

classroom

entity manager

dispatcher

dispatcher

dispatcher

Boundary, control, and entity classes in the same package

Business Package i

AM: VOPC diagramAM: VOPC diagram

VOPC: VOPC: View Of Participating ClassesView Of Participating Classes Show how the system objects work together in Show how the system objects work together in

the realization of a use case.the realization of a use case. Use key abstraction classesUse key abstraction classes Show all the objects involved in a use case for Show all the objects involved in a use case for

the basic flow and alternate flows as well.the basic flow and alternate flows as well. Use simple, non-directed associations Use simple, non-directed associations

between classes involved.between classes involved. Avoid too much detailsAvoid too much details One VOPC diagram per use caseOne VOPC diagram per use case

VOPC diagram for the Create VOPC diagram for the Create Account use caseAccount use case

Figure 5-9

AM: Sequence diagram IAM: Sequence diagram I The VOPC diagram for the use case is the The VOPC diagram for the use case is the

primary source of objects for the sequence primary source of objects for the sequence diagram diagram

Represent a step-by-step description of a Represent a step-by-step description of a complete path through complete path through one scenario one scenario of the use of the use case.case.

One sequence diagram for each possible use One sequence diagram for each possible use case scenario of interest.case scenario of interest.

Create at least one sequence diagram for the Create at least one sequence diagram for the basic flow of each use casebasic flow of each use case

The messages should be descriptive since they The messages should be descriptive since they normally do not match operations of the normally do not match operations of the associated classes.associated classes.

AM: Sequence diagram IIAM: Sequence diagram II

Re-write use case description using the Re-write use case description using the boundary, control, and entity classes.boundary, control, and entity classes.

Each step describes “noun-verb-noun”Each step describes “noun-verb-noun”Nouns: actors, boundary, entity classesNouns: actors, boundary, entity classesVerbs: the action the 1Verbs: the action the 1stst noun asks the 2 noun asks the 2ndnd

noun to take.noun to take.Attach the description of each step to the Attach the description of each step to the

sequence diagrams.sequence diagrams.

Sequence diagram for the Create Sequence diagram for the Create Account use caseAccount use case

Figure 5-10

An alternate collaboration when An alternate collaboration when signing in Anonymous Usersigning in Anonymous User

Figure 5-12

AM: Define system testsAM: Define system tests

Use use-case scenarios to define test Use use-case scenarios to define test cases.cases.

Consider all possible combinations of Consider all possible combinations of flows of eventsflows of events

Combine one or more flows of events into Combine one or more flows of events into a use case scenario.a use case scenario.

AM: SummaryAM: Summary Three key Abstraction classes:Three key Abstraction classes:

Boundary classesBoundary classes One screen in Ux is mapped to a boundary classOne screen in Ux is mapped to a boundary class Each external system is assigned a boundary classEach external system is assigned a boundary class

Control classesControl classes A dispatcher control class per use caseA dispatcher control class per use case An entity manger control class per use case packageAn entity manger control class per use case package

Entity classesEntity classes Each business concept in the business entity model is mapped to an entity Each business concept in the business entity model is mapped to an entity

class.class. Managed Entities diagramManaged Entities diagram

An entity manager controls the access to the entities in the use case An entity manager controls the access to the entities in the use case packagepackage

Represents all the persistent entities of the systemRepresents all the persistent entities of the system VOPC diagramVOPC diagram

One VOPC per use caseOne VOPC per use case Sequence diagramSequence diagram

One sequence diagram per use case scenario of interestOne sequence diagram per use case scenario of interest At least one sequence diagram for the basic flow of the use caseAt least one sequence diagram for the basic flow of the use case