7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design...

38
7-1 © Prentice Hall, 2007 Topic 7: Topic 7: Analysis Classes Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer

description

Topic © Prentice Hall, 2007 Chapter Objectives (Continued) Af ter studying this chapter you should be able to: – Convert a communication diagram into analysis classes. – Draw an activity diagram and a state diagram. – Document business rules using Object. Constraint Language (OCL). – Develop decision tables of complex rules.

Transcript of 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design...

Page 1: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

7-1© Prentice Hall, 2007

Topic 7:Topic 7:Analysis ClassesAnalysis Classes

Object-Oriented Systems Analysis and Design

Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer

Page 2: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-2© Prentice Hall, 2007

Chapter ObjectivesChapter ObjectivesAfter studying this chapter you should

be able to:– Stereotype classes into entity, boundary,

and control.– Draw a sequence diagram based on a use

case description.– Translate a sequence diagram into a

communication diagram.

Page 3: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-3© Prentice Hall, 2007

Chapter ObjectivesChapter Objectives(Continued)(Continued)

After studying this chapter you should be able to:– Convert a communication diagram into analysis

classes.– Draw an activity diagram and a state diagram.– Document business rules using Object.

Constraint Language (OCL).– Develop decision tables of complex rules.

Page 4: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-4© Prentice Hall, 2007

Page 5: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-5© Prentice Hall, 2007

Page 6: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-6© Prentice Hall, 2007

What Is an Analysis Class?What Is an Analysis Class?A class that represents initial data and

behavior requirements, and whose software and hardware-oriented details have not been specified

Analysis class diagram – a UML diagram showing analysis classes and their relationships

Page 7: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-7© Prentice Hall, 2007

Stereotypes of Analysis ClassesStereotypes of Analysis Classes

Mostly corresponds to conceptual data model classes

Encapsulates connections between actors and use cases

Mostly performs behaviors associated with inner workings of use cases

Page 8: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-8© Prentice Hall, 2007

Page 9: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-9© Prentice Hall, 2007

What Is a Sequence What Is a Sequence Diagram?Diagram?

A UML diagram that shows the interaction between objects to perform critical pieces of use case behavior in a time-ordered manner

Interactions are in the form of messages

Behavioral responsibilities are assigned to message recipients

Page 10: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-10© Prentice Hall, 2007

Messages are passed between objects, and may contain parameters

Page 11: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-11© Prentice Hall, 2007

Symbols in a Sequence DiagramSymbols in a Sequence Diagram Box or class stereotype symbol represents objects.

Dotted vertical line represents object’s lifetime.

Thin bars represent focus of control, periods of time when object is behaving (fulfilling responsibilities).

Labeled horizontal lines represent messages passing between objects.

Page 12: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-12© Prentice Hall, 2007

Page 13: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-13© Prentice Hall, 2007

Typically, actors interact with boundary classes, which in turn interact with control classes, which in turn interact with entity classes.

Page 14: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-14© Prentice Hall, 2007

What Is Robustness Analysis?What Is Robustness Analysis?

• Involves analyzing the narrative text of each of the use cases and identifying a first-guess set of the objects into entity, boundary, and control classes

• Requires completeness checks and adherence to diagramming rules

Page 15: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-15© Prentice Hall, 2007

Page 16: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-16© Prentice Hall, 2007

What Is a Communication What Is a Communication Diagram?Diagram?

A UML diagram that shows the interactions between objects to perform critical pieces of the use case behavior

Unlike sequence diagrams, communication diagrams have no spatial representation of time; sequences of messages are shown by numbering.

Page 17: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-17© Prentice Hall, 2007

Page 18: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-18© Prentice Hall, 2007

Drawing Analysis Class Drawing Analysis Class DiagramsDiagrams

• Analysis classes are completed by including operations, which fulfill the responsibilities taken by the analysis class.

• In addition, attributes and relationships from the conceptual data model are retained and refined.

Page 19: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-19© Prentice Hall, 2007

Operations (behaviors) are depicted in the lower third of a class box.

Operations fulfill the class’s responsibilities.

Page 20: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-20© Prentice Hall, 2007

What Is an Activity Diagram?What Is an Activity Diagram?

A diagram that emphasizes the flow of control from activity to activity in an object

Similar to the traditional program flowchart

Used to provide detail for complex algorithms

Page 21: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-21© Prentice Hall, 2007

Elements of Activity DiagramsElements of Activity Diagrams Activity – a behavior that an object carries out while in a

particular state

Transition – a movement from one activity or state to another

Decision point – a diamond symbol containing a condition whose results provide transitions to different paths of activities

Swimlanes – lanes that partition the diagram to show who does what activities

Synchronization bar – horizontal or vertical bars denoting parallel or concurrent paths of activities

Page 22: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-22© Prentice Hall, 2007

Activity diagram with the decision points and three swimlanes

Page 23: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-23© Prentice Hall, 2007

Activity diagram with synchronization bars

Top synchronization bar is a fork.

Bottom synchronization bar is a join.

Page 24: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-24© Prentice Hall, 2007

What is a State Diagram?What is a State Diagram? A diagram that captures the behavior of an object by

specifying the sequence of states it goes through during its lifetime in response to events, together with the responses to those events

Also called statechart diagram

-State – a condition or situation during the life of an object at which time it satisfies some condition, performs some activity, or waits for some event.

-All activities are states

Page 25: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-25© Prentice Hall, 2007

Page 26: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-26© Prentice Hall, 2007

When to Use State DiagramsWhen to Use State DiagramsFor describing object behavior across many

use cases

Not useful for describing behavior of many objects collaborating together

Not for everybody…some analysts like them and others do not

Page 27: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-27© Prentice Hall, 2007

What Is a Business Rule?What Is a Business Rule?A directive that is intended to influence or

guide business behavior in support of business policy formulated in response to an opportunity or threat

In information systems, business rules are implemented as data, constraints, and/or program code.

Page 28: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-28© Prentice Hall, 2007

Types of Business RulesTypes of Business RulesConstraints – restrictions, mainly in the

form of permissible values, validation rules, and multiplicities

Calculations – mathematical formulas or algorithms that produce some value

Value inferences – establishing the value of an attribute based on a test condition

Action enablers – deciding on an action based on a test condition

Page 29: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-29© Prentice Hall, 2007

Approaches for Value Inferences Approaches for Value Inferences and Action Enablersand Action Enablers

Decision Tables– Matrix representation of the logic of decisions,

specifying possible conditions and resulting actionsDecision Trees

– Node-and link representation of the paths of choices and decisions

Structured English– Verbal description of decision logic

Page 30: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-30© Prentice Hall, 2007

Components of Decision TablesComponents of Decision TablesCondition stub

– The part of the decision table that lists the conditions relevant to the decision

Action stub– The part of the decision table that lists the possible actions

or values of the decisionRule

– The part of the decision table that specifies the specific mapping of conditions to actions or values

Page 31: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-31© Prentice Hall, 2007

Page 32: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-32© Prentice Hall, 2007

Reducing the Decision TableReducing the Decision Table

A complete decision table may have indifferent conditions for certain rules

Therefore, rules can sometimes be combined to simplify the decision table

Page 33: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-33© Prentice Hall, 2007

Page 34: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-34© Prentice Hall, 2007

What is Object Contraint What is Object Contraint Language (OCL)?Language (OCL)?

An formal, declarative language add-on to UML for writing expressions that unambiguously specify business rules

OCL expressions consist of:– Context – the element for which the expression is

defined– Invariant – A constraint that should be true for an

object during its lifetime

Page 35: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-35© Prentice Hall, 2007

Elements of OCL ExpressionsElements of OCL Expressions

Context – the element for which the expression is defined

For each context, you can specify– Initial values– Derivation rules– Constraints– Query optimizations– Invariants– Pre- and Post-conditions

Page 36: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-36© Prentice Hall, 2007

OCL Expressions

Page 37: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-37© Prentice Hall, 2007

RecapRecap

After studying this chapter we learned to:– Stereotype classes into entity, boundary,

and control.– Draw a sequence diagram based on a use

case description.– Translate a sequence diagram into a

communication diagram.

Page 38: 7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.

Topic 7 7-38© Prentice Hall, 2007

Recap (cont.)Recap (cont.)

After studying this chapter we learned to:– Convert a communication diagram into analysis

classes.– Draw an activity diagram and a state diagram.– Document business rules using Object.

Constraint Language (OCL).– Develop decision tables of complex rules.