11.10.2013 Views

Slides Part 2 (OOA, pages 1-128, pdf, 4 slides per page)

Slides Part 2 (OOA, pages 1-128, pdf, 4 slides per page)

Slides Part 2 (OOA, pages 1-128, pdf, 4 slides per page)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LITERATURE<br />

The Fusion Method using UML<br />

Dereck Coleman, Patrick Arnold, Stephanie Bodoff, Chris Dollin, Helena<br />

Gilchrist, F. Hayes and P. Jeremaes:<br />

Object-Oriented Development: The Fusion Method<br />

Prentice-Hall, 1994<br />

(out of print)<br />

1<br />

3<br />

THE FUSION METHOD<br />

➠ was developed by Hewlett-Packard<br />

➠ not only offers notations, but also a methodological guidance<br />

➠ consists of developing a series of models<br />

➠ covers the phases <strong>OOA</strong>, OOD, OOP<br />

➠ in this lecture: <strong>OOA</strong>, OOD<br />

➠ prerequisite: The result of an informal requirements elicitation is available<br />

2<br />

Overview<br />

4


ANALYSIS<br />

➠ Goal: Comprehension and description of the visible system behavior within<br />

the application context.<br />

➠ Implementation considerations are not into account.<br />

➠ Models of analysis:<br />

• class model: displays the application context; relations between classes<br />

• system o<strong>per</strong>ations<br />

• <strong>per</strong>mitted sequences of system o<strong>per</strong>ations<br />

Note: Classes in the Fusion analysis phase have no o<strong>per</strong>ations (yet)!<br />

5<br />

The Fusion Analysis Process<br />

7<br />

DESIGN, IMPLEMENTATION<br />

➠ Design:<br />

• Goal: abstract implementation concept<br />

• System o<strong>per</strong>ations are represented by the runtime behavior of<br />

interacting objects<br />

➠ Implementation:<br />

• Transforms design models into an executable code<br />

• system class model ❀ classes of the programming language<br />

• object interactions ❀ method calls<br />

• Permitted sequences ❀ control structures<br />

Simultaneously: data dictionary, consistency checks<br />

Starting point: Description of facts and requirements using natural language.<br />

Multiple steps, in each of which a model is developed.<br />

1. Class model<br />

Describes objects and concepts of the problem environment<br />

2. Use case model<br />

Coarse-grained functionality of the system<br />

3. Scenarios<br />

Refinement of the use case model<br />

Identification of system o<strong>per</strong>ations<br />

4. O<strong>per</strong>ation model<br />

Specification of the system o<strong>per</strong>ations as relations between the “before”<br />

and “after” states<br />

6<br />

8


5. System class model<br />

Borderline between system and environment<br />

Refinement of the class model<br />

6. Life-Cycle model<br />

Global system behavior<br />

Behavior of objects<br />

DATA DICTIONARY<br />

Contains all used names; representation as a table:<br />

Name Kind Description Source<br />

Name of the<br />

element<br />

Class, system o<strong>per</strong>ation,<br />

attribute,<br />

etc.<br />

9<br />

Short informal<br />

description<br />

Must be maintained throughout the entire development process!<br />

11<br />

All models that contain<br />

the name<br />

➠ Static aspects of the system: Class model<br />

➠ Dynamic aspects of the system: Interface model<br />

consisting of<br />

• Use cases<br />

• Scenarios<br />

• O<strong>per</strong>ation model<br />

• Life-Cycle model<br />

EXAMPLE<br />

Name Kind Description Source<br />

account.number attribute Unique account number<br />

of an account.<br />

Bank class A bank consists of a<br />

number of accounts<br />

open account system<br />

o<strong>per</strong>ation<br />

Transaction life-cycle<br />

expression<br />

10<br />

A customer opens an account<br />

at a bank<br />

A transaction is either an<br />

deposit, a withdrawal, or<br />

a balance query.<br />

class model<br />

class model,<br />

system<br />

model<br />

class<br />

scenario, o<strong>per</strong>ation<br />

model<br />

life-cycle model


ASSOCIATIONS<br />

The class model<br />

➠ denote the relations between objects<br />

➠ are drawn as links between classes<br />

➠ can have an arity of more than two<br />

➠ can have names (convention: use capital letters)<br />

➠ can have multiplicities<br />

➠ can have role names<br />

13<br />

15<br />

MODELING THE STATIC ASPECTS OF THE APPLICATION CONTEXT<br />

Different notations for classes:<br />

or or<br />

Class Class Class<br />

a1: T1<br />

a2 : T2<br />

a1: T1<br />

a2 : T2<br />

op1(p: T1) : T2<br />

Classes in the Fusion analysis phase only have basic attributes (i. e., no<br />

object attributes) and no o<strong>per</strong>ations!<br />

EXAMPLE<br />

Professor Institute<br />

1 Leads 0..1<br />

name<br />

name<br />

specialty<br />

director<br />

0..2<br />

Gives<br />

*<br />

Course<br />

title<br />

4..6 Takes 3..*<br />

Student<br />

name<br />

participant inscription_number<br />

14<br />

role<br />

association name<br />

mulitplicity reading direction<br />

16


MEANING OF THE CLASS DIAGRAM<br />

➠ Each institute has exactly one professor who leads it.<br />

➠ This professor is called ”director”.<br />

➠ A professor leads at most one institute.<br />

➠ A professor can give course, but need not do so.<br />

➠ Each course is given by at most two professors (also zero professors are<br />

possible).<br />

➠ A student takes four to six courses.<br />

➠ There, he is a “participant”.<br />

➠ A course has to be taken by at least three students.<br />

ROLE NAMES<br />

➠ are written at the ends of the links<br />

➠ <strong>per</strong> convention, role names are written in small letters<br />

Person<br />

1..*<br />

child<br />

17<br />

IsChildOf<br />

19<br />

parent<br />

2<br />

ASSOCIATIONS WITH ARITY GREATER THAN TWO<br />

Associations can exist between more than two classes.<br />

MULTIPLICITIES<br />

Student Exam<br />

Room<br />

Writes<br />

➠ express cardinality constraints of relations<br />

18<br />

➠ for each object o of Class2, there exist m objects o ′ of Class1, such that o<br />

and o ′ are in relation Rel.<br />

Notation:<br />

Class1<br />

Rel<br />

Class2<br />

m<br />

• number n: exactly n objects<br />

• scope i..j<br />

• * : any number, also 0<br />

• i..∗ : at least i<br />

• ∗..j : at most j<br />

• not specified : means *<br />

• 0..1, 3..4, 6..∗ :<br />

20<br />

all quantities except 2 and 5


ASSOCIATION CLASSES<br />

➠ Associations can also have attributes.<br />

➠ Reasonable, if the attributes cannot be assigned to any of the classes<br />

involved in the association.<br />

Writes<br />

Student Exam<br />

Writes<br />

mark<br />

GENERALIZATION/SPECIALIZATION<br />

➠ Classes correspond to types.<br />

➠ Subclasses correspond to subtypes, not subsets.<br />

➠ Specialization = ”is a” , but ”act as” , ”is a kind of”<br />

BachelorCourse MasterCourse<br />

subject<br />

21<br />

Course Personnel Student<br />

Constraint<br />

title<br />

name<br />

name<br />

<strong>per</strong>s.nr<br />

inscription_number<br />

salary<br />

{complete}<br />

specialization<br />

23<br />

Professor TeachingAssistent<br />

specialty<br />

AGGREGATION AND COMPOSITION<br />

are special associations.<br />

Room<br />

Wall<br />

The wall is a part of the room.<br />

If a part belongs to only one whole and can only exist with that whole, then this<br />

is a composition relation.<br />

CONSTRAINTS<br />

Window<br />

Frame<br />

or<br />

➠ Are conditions that must hold.<br />

➠ Are written between “{}”.<br />

22<br />

Window<br />

Frame<br />

➠ The example: “{complete}” means that no other subclasses of Course<br />

can exist.<br />

➠ Meaning of constraints must be described informally.<br />

24


STRUCTURING CLASS MODELS<br />

In general the class model must divided into different diagrams. The following<br />

conventions must be obeyed:<br />

➠ Modeling elements with the same name represent the same element.<br />

➠ The set of the attributes of an element is the union of the attributes of all<br />

element representations.<br />

➠ Multiplicities are combined by conjunction, i.e., 1..14 and 0..5 yields 1..5.<br />

➠ Role names must be unique.<br />

25<br />

• The contents of an already placed contract only changes if the client<br />

wishes for changes and the central office approves of these changes. A<br />

client contacts an employee of the agency and informs the employee about<br />

the desired changes. The employee notifies the central office about the<br />

change request. The central office then decides on accepting the request<br />

or not and making changes if necessary.<br />

The procedure for canceling contracts proceeds analogously.<br />

• The data concerning product changes and launches is adjusted monthly.<br />

Here, the central office updates the databases of the agencies for each<br />

product.<br />

27<br />

EXAMPLE: INSURANCE AGENCY<br />

A software system is to be developed for managing an insurance agency.<br />

• The following products are offered: Health insurance- (HI), automobile<br />

liability- (AL) and private liability (PL).<br />

• An employee prepares offers for individual products. These offers contain<br />

the essential data for the respective insurance. The product information<br />

must be available in form of a database. Client data must be entered if they<br />

are not yet present.<br />

• The employee prepares the application together with the client. The<br />

application is sent from the agency to the central office. The central office<br />

checks the application and records the data in its system. If a contract can<br />

be placed, the central office sends this contract to the agency in electronic<br />

form. A newly placed contract can only refer to a current product.<br />

26<br />

• In case of an occurrence of event insured, the client has to contact an<br />

employee of the agency. In case of AL and PL insured events, the agency<br />

authorizes an ex<strong>per</strong>t advisor who appraises the damage and sends the<br />

corresponding report back to the agency via Internet. In insured events<br />

within the scope of HI, no ex<strong>per</strong>t advisor is appointed. The central office<br />

can decide on assuming the payment for an insured event or not. In cases<br />

of AL and PL, the agency determines the settlement of a claim on the<br />

basis of the ex<strong>per</strong>t advisor’s report.<br />

28


PreparesAppl<br />

CLASS MODEL FOR THE INSURANCE AGENCY<br />

Client<br />

clientData<br />

Employee<br />

Application<br />

Checks<br />

CentralOffice<br />

ForAppl<br />

Updates<br />

1<br />

PreparesOffer<br />

Settles<br />

1<br />

Offer<br />

offerData<br />

Product<br />

productData<br />

HI AL PL<br />

Approves<br />

1<br />

WorksFor<br />

ForOffer<br />

1<br />

Decides_onHI<br />

RefersTo<br />

29<br />

Contract<br />

ContractData<br />

Agency<br />

InsuredEvent<br />

Concerning<br />

The Use case model<br />

31<br />

Authorizes<br />

Ex<strong>per</strong>tAdvisor<br />

HI−Event<br />

Report<br />

AL/PL−Event<br />

DecidesOn<br />

Prepares<br />

OBJECT-ORIENTED ANALYSIS<br />

➠ Class model =⇒ Static aspects<br />

➠ Interface model =⇒ Dynamic aspects<br />

AIM<br />

• Use case model<br />

• Scenarios<br />

• O<strong>per</strong>ation model<br />

• System class model<br />

• Life-Cycle model<br />

➠ Coarse-grained view of the system.<br />

➠ Identification of function groups.<br />

PROCEDURE<br />

➠ Identify actors<br />

➠ Identify use cases<br />

➠ Identify associations between actors and use cases<br />

30<br />

32


ACTORS<br />

➠ are outside of the system<br />

➠ represent different user roles<br />

➠ can be either human beings or other systems<br />

➠ should appear in the class model<br />

➠ corresponding classes are not implemented<br />

➠ Notation:<br />

BankClerk<br />

DESCRIPTION OF SEQUENCES OF ACTIONS<br />

➠ necessary, because ovals do not convey any semantics<br />

➠ verbally or with scenarios, which are represented as diagrams<br />

➠ Distinction of<br />

• Normal cases (main flow of events)<br />

• Error cases (exceptional flow of events)<br />

33<br />

35<br />

USE CASES<br />

➠ are sets of sequences of actions<br />

➠ must have a name<br />

➠ describe the interaction between actors and the system<br />

➠ Criteria:<br />

The system supplies an observable result which is of use for the actor.<br />

➠ Notation:<br />

Process<br />

Loan<br />

EXAMPLE: USE CASE ”‘AUTHENTICATE USER”’<br />

➠ Normal case:<br />

1. System asks user for PIN<br />

2. User enters PIN<br />

3. System checks correctness<br />

➠ Exceptional cases:<br />

• User enters wrong PIN 3 times<br />

• User aborts transaction<br />

• User mistyped, presses CLEAR-Button<br />

34<br />

36


Use case diagrams<br />

COMMON BEHAVIOR CAN FACTORED OUT<br />

➠ include-relation<br />

A use case explicitly contains another. The latter does not appear on its<br />

own, instead it serves to avoid repetitions.<br />

Place<br />

Order<br />

37<br />

dependency<br />

<br />

Authenticate<br />

User<br />

39<br />

stereotype<br />

GENERALIZATION-/SPECIALIZATION RELATIONS<br />

are possible for actors as well as use cases:<br />

CommercialCustomer<br />

Customer<br />

Check<br />

Password<br />

Authenticate<br />

User<br />

Scan<br />

Retina<br />

UML 2.0: Use cases may have attributes and o<strong>per</strong>ations, and behavior may be<br />

specified with state machines.<br />

NEW LANGUAGE ELEMENTS<br />

➠ Dependency: --------><br />

38<br />

Change in independent things (at the arrow head) causes a change in<br />

dependent things.<br />

e.g. change in PlaceOrder when AuthenticateUser changes.<br />

➠ Stereotypes: ><br />

• Extension of UML by new basic elements.<br />

• describes the above mentioned-dependency between<br />

use cases.<br />

• When verbally describing PlaceOrder, then AuthenticateUser must also<br />

be described.<br />

• There is an additional dependency with a predefined stereotype,<br />

namely .<br />

40


➠ extend-relation<br />

extension points:<br />

RushOrder<br />

PlaceOrder<br />

<br />

Place<br />

Rush<br />

Order<br />

Condition: {rushOrderCond}<br />

extension point: RushOrder<br />

• Base use case can appear on its own, but in some cases its behavior is<br />

extended through another use case.<br />

• This expresses optional system behavior.<br />

• Sequence of actions: If condition is satisfied at extension point, then<br />

optional behavior is executed.<br />

• Note: Here the dependency is the other way around than with<br />

! The optional behavior depends on the basic behavior!<br />

ANOTHER EXAMPLE<br />

BankClerk<br />

LoanEx<strong>per</strong>t<br />

extension points:<br />

NC<br />

OpenAccount<br />

Close<br />

Account<br />

Process<br />

Transaction<br />

extension points:<br />

NC<br />

ProcessLoan<br />

41<br />

Condition: {NewClient}<br />

extension point: NC<br />

<br />

<br />

Schufa−<br />

Query<br />

Bank<br />

Schufa<br />

Note: Loan ex<strong>per</strong>ts are allowed to open accounts while ”‘regular”’ employees<br />

are not allowed to process loans.<br />

43<br />

LAST STEP<br />

• Use associations for connecting the actors with the use cases.<br />

• Draw system boundaries.<br />

Example: Cellular telephone<br />

CellularNetwork<br />

User<br />

extension points:<br />

CC<br />

PlacePhoneCall<br />

Place<br />

Conference−<br />

call<br />

Condition: {CCButtonPressed}<br />

extension point: CC<br />

extension points:<br />

RAC<br />

<br />

ReceivePhoneCall<br />

Condition: {AddCallArr}<br />

extension point: RAC<br />

Use<br />

Scheduler<br />

42<br />

Receive<br />

additional<br />

call<br />

Cellular Telephone<br />

USE CASE MODEL FOR THE INSURANCE AGENCY<br />

Employee<br />

extension points:<br />

CD<br />

Prepare<br />

offer<br />

extension points:<br />

CD<br />

Prepare Application/Contract<br />

Update<br />

Products<br />

Change/<br />

cancel<br />

contract<br />

Treat<br />

ensured<br />

event<br />

<br />

<br />

Treat<br />

HI ensured<br />

event<br />

Treat<br />

AL/PL ensured<br />

event<br />

44<br />

Enter<br />

Client<br />

Data<br />

Condition: {NoClientData}<br />

extension point: CD<br />

<br />

Authorize<br />

report<br />

Agency<br />

CentralOffice<br />

Ex<strong>per</strong>tAdvisor


Next step: Describing sequences of actions<br />

SCENARIOS<br />

➠ Describe all sequences of actions contained in the use cases.<br />

➠ Describe communication flows between the system and its environment.<br />

45<br />

➠ <strong>Part</strong>icipants: System as well as actors according to the use case diagram.<br />

➠ Notation: UML 2.0 sequence diagrams.<br />

➠ At least one scenario must exist for each use case!<br />

➠ Each scenario describes one possible flow of events (normal case or<br />

exceptional case).<br />

47<br />

OBJECT-ORIENTED ANALYSIS<br />

➠ Class model =⇒ Static aspects<br />

➠ Interface model =⇒ Dynamic aspects<br />

• Use case model<br />

• Scenarios<br />

• O<strong>per</strong>ations model<br />

• System class model<br />

• Life-Cycle model<br />

MODELING ALTERNATIVES<br />

➠ Define one scenario for each normal case and each exceptional case<br />

+ simple scenarios<br />

- repetitions<br />

➠ Use combined fragments to define scenarios<br />

+ exploit include- and extend-relations from use case model<br />

- scenarios become more complex<br />

- no indeterminism; conditions have to be given<br />

46<br />

48


EXAMPLE: OPENING AN ACCOUNT<br />

• Normal case 1: A new customer wants to open an account. A Schufa query<br />

is necessary. Schufa confirms credit-worthiness, the account is opened.<br />

• Exceptional case 1: A new customer wants to open an account. Schufa<br />

query is negative. Account-opening is rejected.<br />

• Exceptional case 2: A customer wants to open an account as new<br />

customer. This customer is however already known as customer.<br />

• Normal case 2: A customer wants to open another account.<br />

Credit-worthiness is checked in-house. Credit-worthiness is good, account<br />

is opened.<br />

• Exceptional case 3: A customer wants to open another account.<br />

Credit-worthiness is checked in-house. Credit-worthiness is negative,<br />

account-opening rejected.<br />

NOTE:<br />

➠ System o<strong>per</strong>ations are arrows from an actor to the system.<br />

➠ We use asynchronous messages to model system o<strong>per</strong>ations (UML2.0<br />

also allows synchronous and reply messages).<br />

➠ Output events are arrows from the system to an actor.<br />

➠ Parameters are not yet specified.<br />

49<br />

➠ Each scenario has to start with a system o<strong>per</strong>ation (i. e., the system does<br />

not initiate anything)<br />

➠ Not all system o<strong>per</strong>ations have associated output events.<br />

➠ In general, a scenario may contain several actors, system o<strong>per</strong>ations and<br />

output events.<br />

➠ The output is not necessarily sent to the actor who calls the system<br />

o<strong>per</strong>ation.<br />

51<br />

SIMPLE SCENARIOS: NORMAL CASE 1<br />

sd OpenAccountN1<br />

BankClerk<br />

open_new_customer_account<br />

account_opened<br />

name<br />

system (object) (not underlined)<br />

: Bank<br />

schufa_query<br />

credit_worthiness_ok<br />

50<br />

Schufa<br />

output event<br />

SIMPLE SCENARIOS: EXCEPTIONAL CASES 1 AND 2<br />

sd OpenAcccountE1<br />

system o<strong>per</strong>ation<br />

lifeline<br />

actor<br />

(asynchronous message)<br />

Scenario for exceptional case 1: Scenario for exceptional case 2:<br />

BankClerk<br />

account_not_opened<br />

sd OpenAcccountE2<br />

: Bank : Bank<br />

Schufa BankClerk<br />

open_new_customer_account open_new_customer_account<br />

schufa_query<br />

credit_worthiness_not_ok<br />

52<br />

customer_already_known


SIMPLE SCENARIOS: NORMAL CASE 2 AND EXCEPTIONAL CASE 3<br />

Scenario for normal case 2:<br />

sd OpenAcccountN2<br />

sd OpenAcccountE3<br />

: Bank<br />

BankClerk BankClerk<br />

account_opened<br />

Szenario for exceptional case 3:<br />

open_known_customer_accout open_known_customer_accout<br />

ignore to define messages to be ignored in the execu<br />

loop repetition<br />

neg to define forbidden behavior<br />

53<br />

account_not_opened<br />

par parallel independent execution of several o<strong>per</strong>ands tion<br />

seq weak sequencing (default)<br />

strict strict sequencing<br />

We will only use alt and opt.<br />

Moreover: ref: Reference to another sequence diagram.<br />

Avoids repetitions; semantics: replace reference by its contents.<br />

55<br />

: Bank<br />

COMBINED FRAGMENTS<br />

O<strong>per</strong>ators for combining different sequence diagrams. The following o<strong>per</strong>ators<br />

are defined:<br />

alt alternatives; more than two alternatives are possible.<br />

opt option<br />

assert assertion, to define a message sequence that must occur<br />

break description of behavior expected after a break<br />

coregion messages can be received in any order<br />

consider to define messages to be considered in the execution; equivalent to<br />

defining every other message to be ignored<br />

critical critical region<br />

PATTERN FOR MODELING “”<br />

sd UC1_i<br />

54<br />

<br />

UC1 UC2<br />

:X :Y<br />

ref<br />

M1<br />

M2<br />

M3<br />

M4<br />

UC2<br />

56


PATTERN FOR MODELING “”<br />

REMARKS<br />

extension points:<br />

EXT<br />

UC1<br />

sd UC1_i<br />

:X :Y<br />

opt<br />

[U2_Cond]<br />

<br />

M1<br />

M2<br />

➠ Nested combined fragments are possible.<br />

Op1<br />

Op2<br />

EXT<br />

M3<br />

M4<br />

57<br />

UC2<br />

Condition: {U2_Cond}<br />

extension point: EXT<br />

Condition or<br />

Continution<br />

Secnario ofr UC2<br />

➠ In this example, we did not use the pattern for “”, because<br />

we had to make a more general case distinction (customer already known<br />

or not).<br />

➠ Conditions have to be given for the alt and opt o<strong>per</strong>ators.<br />

59<br />

COMBINED FRAGMENTS: NORMAL CASE 1, EXCEPT. CASES 1, 2<br />

sd OpenAccountS1<br />

: Bank<br />

BankClerk Schufa<br />

open_new_customer_account<br />

alt<br />

[ClientKnown]<br />

customer_already_known<br />

[else]<br />

alt<br />

[queryOK]<br />

[else]<br />

account_opened<br />

account_not_opened<br />

REFERENCED SCENARIO<br />

sd SchufaQuery<br />

alt<br />

[creditWorthinessOK]<br />

[else]<br />

: Bank<br />

ref<br />

58<br />

schufa_query<br />

SchufaQuery<br />

credit_worthiness_ok<br />

credit_worthiness_not_ok<br />

60<br />

Schufa


METHOD<br />

➠ Consider all use cases given in the use case diagram.<br />

➠ For each use case:<br />

• Enumerate all normal and exceptional cases.<br />

• Set up a simple scenario for each case, or use combined fragments to<br />

cover several cases.<br />

➠ Collect the names of all arrows from an actor to system. These are the<br />

system o<strong>per</strong>ations which have to be specified in the following.<br />

USE CASE “PREPARE OFFER”, SIMPLE SCENARIOS<br />

sd PrepareOfferN1 sd PrepareOfferN2<br />

Employee<br />

c_data_present?<br />

c_data_present!<br />

prepare_offer<br />

offer_prepared<br />

61<br />

: Agency : Agency<br />

63<br />

Employee<br />

c_data_present?<br />

c_data_not_present!<br />

enter_c_data<br />

c_data_entered<br />

prepare_offer<br />

offer_prepared<br />

Scenarios for the insurance agency<br />

USE CASE “PREPARE OFFER”, COMBINED FRAGMENTS<br />

sd PrepareOffer<br />

Employee<br />

62<br />

c_data_present?<br />

alt<br />

[cdp] c_data_present!<br />

[else]<br />

c_data_not_present!<br />

enter_c_data<br />

c_data_entered<br />

prepare_offer<br />

offer_prepared<br />

64<br />

: Agency


OBJECT-ORIENTED ANALYSIS<br />

➠ Class model =⇒ Static aspects<br />

➠ Interface model =⇒ Dynamic aspects<br />

AIM<br />

• Use case model<br />

• Scenarios<br />

• O<strong>per</strong>ation model<br />

• System class model<br />

• Life-Cycle model<br />

➠ Descriptive specification of exactly the identified system o<strong>per</strong>ations<br />

➠ Specification of the state changes and generated output events<br />

➠ No programming, no behavior inside the system.<br />

➠ An o<strong>per</strong>ation schema must be specified for each system o<strong>per</strong>ation.<br />

➠ O<strong>per</strong>ation model = set of o<strong>per</strong>ation schemas<br />

65<br />

67<br />

The o<strong>per</strong>ation model<br />

EACH OPERATION SCHEMA CONTAINS<br />

➠ Name of the system o<strong>per</strong>ation<br />

➠ Informal description<br />

➠ Input/Output, communication with environment<br />

66<br />

➠ Assumptions on the state of the system before execution of the o<strong>per</strong>ation.<br />

➠ State change (effect) achieved by the o<strong>per</strong>ation.<br />

68


FUSION NOTATION<br />

O<strong>per</strong>ation = 〈Name〉<br />

Description = 〈Informal description〉<br />

Reads = 〈Input〉<br />

Changes = 〈Objects/Attributes/Associations, that might be changed 〉<br />

Sends = 〈Output events〉<br />

Pre = 〈Precondition〉<br />

Post = 〈Postcondition〉<br />

Sends Events that can be but do not have to be created.<br />

Must contain all output events occurring in the scenarios.<br />

Receiving actor is stated, e.g.<br />

Employee: {give money(amount), no cover}<br />

69<br />

Pre refers to the system state before calling the system o<strong>per</strong>ation and the<br />

supplied values.<br />

The effect of system o<strong>per</strong>ation as given by postcondition is only specified if<br />

the precondition is fulfilled.<br />

The precondition should be established by the sequences of events<br />

specified in the scenarios and in the life-cycle model.<br />

71<br />

COMPONENTS OF AN OPERATION SCHEMA<br />

Reads Objects/Attributes/Associations, whose state or value can be read but<br />

not changed.<br />

Keyword supplied for arguments that are from an actor (from exterior)<br />

Inputs that are not ”‘supplied”’ come from the internal state.<br />

Changes The concerned values can be read as well as changed but need not<br />

be changed.<br />

Keyword new for objects that are created by the system o<strong>per</strong>ation.<br />

Keyword delete for objects that are deleted by the system o<strong>per</strong>ation.<br />

Reads and Changes clauses must be disjoint!<br />

Post Relation (expressed as predicate) between pre-state and inputs on the<br />

one hand and post-state and outputs on the other hand.<br />

Variables of the post-state are decorated with ”‘ ′ ”’.<br />

70<br />

Predicate is sent{event} describes that event is sent to the actor given in<br />

the sends-clause as an effect of the system o<strong>per</strong>ation.<br />

No program! Only the effect is specified but not how it is achieved!!!<br />

72


Excursion: Design by Contract<br />

What are preconditions and postconditions good<br />

EXAMPLE<br />

I want to travel from Berlin to Duisburg.<br />

for?<br />

Commitments Advantages<br />

Passenger Pay ticket getting to Duisburg<br />

Traffic<br />

provider<br />

73<br />

Be there at departure time<br />

must keep precondition Has advantages from the postcondition<br />

Must take the passenger to<br />

Duisburg<br />

receives the price for the ticket;<br />

does not have to take passengers<br />

who have not paid or did not arrive<br />

in time<br />

Must guarantee postcond. Can assume precondition<br />

75<br />

SOURCE<br />

Bertrand Meyer<br />

Object-Oriented Software Construction<br />

Prentice Hall 1988 (1. Aufl.), 1997 (2. Aufl.)<br />

online see:<br />

http://archive.eiffel.com/doc/manuals/technology/contract/<strong>page</strong>.html<br />

CONTRACTS IN DAILY LIFE<br />

➠ Contractual partners are clients and sellers or service providers.<br />

➠ Both expect advantages from the contract and are willing to make a<br />

commitment.<br />

ADVANTAGES OF EXPLICIT CONTRACTS<br />

Meyer:<br />

74<br />

A contract document protects both the client, by specifying how much<br />

should be done, and the supplier, by stating that the supplier is not<br />

liable for failing to carry out tasks outside of the specified scope.<br />

APPLICATION TO SOFTWARE<br />

A contract is a formal agreement between a system / a class and its actors /<br />

clients. It specifies the rights and duties for both sides.<br />

76


EXAMPLE: STACK (GENERIC CLASS)<br />

class Stack[T]<br />

attribute nb elements: integer<br />

method empty(): Boolean<br />

full(): Boolean<br />

push(x: T)<br />

pop()<br />

top(): T<br />

end class Stack[T]<br />

pop()<br />

pre not empty<br />

post not full and nb elements’ = nb elements - 1<br />

and ”‘top element of the stack is deleted ”’<br />

top(): T<br />

pre not empty<br />

post noChange and Result = ”‘top element of the stack”’<br />

77<br />

79<br />

SPECIFICATION OF THE STACK OPERATIONS WITH<br />

PRECONDITIONS AND POSTCONDITIONS<br />

empty()<br />

full()<br />

pre true<br />

post Result = true ⇔ nb elements = 0<br />

pre true<br />

post Result = true ⇔ nb elements = . . .<br />

push(x: T)<br />

pre not full<br />

post not empty and nb elements’ = nb elements + 1<br />

and ”‘x is the new top element of the stack”‘<br />

COMMITMENTS AND ADVANTAGES<br />

Commitments Advantages<br />

Client Call push(x) only if stack is<br />

not full<br />

78<br />

Element x is put on stack, top() results<br />

in x, nb elements increases<br />

by 1.<br />

Must keep precondition has advantages from postcondition<br />

Server Makes sure that x is placed<br />

on the stack<br />

Must guarantee postcondition<br />

80<br />

Unnecessary to handle the case if<br />

stack is full.<br />

Can assume precondition


APPLICATION OF THE DESIGN-BY-CONTRACT-PRINCIPLE<br />

➠ Fusion <strong>OOA</strong>: Specifies system o<strong>per</strong>ations by means of preconditions and<br />

postconditions.<br />

➠ Fusion OOD: Specifies all added o<strong>per</strong>ations by means of preconditions<br />

and postconditions.<br />

➠ OOI: Give preconditions and postconditions as documentation in the<br />

source code.<br />

➠ There are programming languages (e. g. Eiffel) which allow for dynamic<br />

checking of preconditions and postconditions.<br />

CLASS MODEL FOR BANK<br />

Schufa<br />

Bank<br />

81<br />

Queries<br />

Owns<br />

Customer Account<br />

Checking<br />

Keeps<br />

Works_for<br />

Savings Credit<br />

83<br />

BankClerk<br />

LoanEx<strong>per</strong>t<br />

EXAMPLE: WITHDRAW MONEY FROM BANK ACCOUNT<br />

sd WithdrawN<br />

sd<br />

: Bank<br />

WithdrawE<br />

BankClerk BankClerk<br />

withdraw_money<br />

withdraw_money<br />

give_money no_cover<br />

OPERATION SCHEMA<br />

82<br />

O<strong>per</strong>ation = withdraw money<br />

Description = Money should be withdrawn from an account. This is possible<br />

only if the account is not overdrawn.<br />

Reads = supplied accountnr : Accountnr<br />

supplied amount : N<br />

: Bank<br />

Changes = account : Account with account.number = accountnr<br />

with: Predicate which uniquely determines an object.<br />

number must be introduced as attribute of the class Account<br />

(=⇒ system class model)<br />

84


Sends = BankClerk: {give money(amount), no cover}<br />

Pre = accountnr is a valid account number, account.balance ≥ 0<br />

Post = If account.balance − amount ≥ 0:<br />

account.balance ′ = account.balance − amount<br />

is sent{give money(amount)}<br />

If account.balance − amount < 0:<br />

account.balance ′ = account.balance<br />

is sent{no cover}<br />

account.balance ′ ≥ 0<br />

=⇒ The class Account has the attribute balance.<br />

account.balance ≥ 0: Invariant. Contained in pre- and in postcondition.<br />

Note: the output event give money gets a parameter (These are not contained<br />

in the scenarios ).<br />

MORE EXAMPLES<br />

sd OpenAccountS1<br />

: Bank<br />

BankClerk Schufa<br />

open_new_customer_account<br />

alt<br />

[ClientKnown]<br />

customer_already_known<br />

[else]<br />

alt<br />

[queryOK]<br />

account_opened<br />

[else]<br />

account_not_opened<br />

ref<br />

85<br />

87<br />

SchufaQuery<br />

REMARK<br />

The precondition of the o<strong>per</strong>ation must be consistent with the scenarios.<br />

If it cannot be taken for granted that only valid account numbers can be given<br />

as a parameter of the o<strong>per</strong>ation withdraw money, then a scenario must be<br />

added that states how to treat the case of an invalid account number.<br />

Once such a scenario is added, the precondition “accountnr is a valid account<br />

number” may be dropped.<br />

Assumption: cd is sufficient to distinguish different customers<br />

86<br />

O<strong>per</strong>ation = open new customer account<br />

Description = A new customer wants to open an account. A query is sent to<br />

the Schufa before the account can be opened.<br />

Reads = supplied cd : Customer data<br />

Changes = —<br />

Sends = BankClerk: {customer already known},<br />

Schufa: {schufa query(cd))}<br />

Pre = —<br />

Post = If exists account : Account with account.customer data = cd:<br />

is sent{customer already known}<br />

Otherwise: is sent{schufa query(cd)}<br />

=⇒ The class Account has the attribute customer data.<br />

88


SCHUFA QUERY<br />

REMARKS<br />

sd SchufaQuery<br />

alt<br />

[creditWorthinessOK]<br />

[else]<br />

: Bank<br />

schufa_query<br />

credit_worthiness_ok<br />

credit_worthiness_not_ok<br />

89<br />

Schufa<br />

• Associations are sets of tuples (in case of binary associations: sets of<br />

pairs).<br />

• When a new object is created, all associations of the corresponding class<br />

must be considered, and new tuples involving the new object have to be<br />

added if appropriate.<br />

• In the example, the new account is added to the Keeps association which<br />

holds between the bank and its accounts.<br />

• The scenario OpenAccountS1 guarantees that the precondition of the<br />

system o<strong>per</strong>ation credit worthiness ok is fulfilled.<br />

• It is not stated how the new account number is determined.<br />

• We abstract from details of the customer data.<br />

91<br />

O<strong>per</strong>ation = credit worthiness ok<br />

Description = Schufa confirms credit-worthiness of the new customer. The account<br />

can be opened.<br />

Reads = supplied cd : Customer data<br />

bank : Bank<br />

Changes = Keeps, new account : Account<br />

Sends = BankClerk: {account opened(accountnr)},<br />

Pre = exists no account : Account with account.customer data = cd<br />

Post = Keeps ′ = Keeps ∪{(bank, account)}<br />

UML NOTATION<br />

account.customer data ′ = cd, account.balance ′ =0<br />

account.number ′ = accountnr, where accountnr is a new account<br />

number<br />

is sent{account opened(accountnr)}<br />

90<br />

Sequence of tagged values, i. e., sequence of pairs consisting of keyword and<br />

value.<br />

sd o<strong>per</strong>ation<br />

Actor<br />

o<strong>per</strong>ation<br />

{Description = ...,<br />

Reads = ...,<br />

Changes = ...,<br />

Sends = ...,<br />

Pre = ...,<br />

Post = ... }<br />

92<br />

: System


RULES<br />

➠ An o<strong>per</strong>ation schema must be set up for each system o<strong>per</strong>ation occurring<br />

in the scenarios.<br />

➠ The actors given in the sends-clause must be the same as in the<br />

scenarios.<br />

➠ The entities in the reads- and changes-clauses must be disjoint.<br />

➠ Preconditions and scenarios must be consistent (number and type of error<br />

cases)<br />

➠ The actors are responsible for guaranteeing the precondition of a system<br />

o<strong>per</strong>ation! The system o<strong>per</strong>ation does not check if the precondition is<br />

fulfilled, but assumes that it is!<br />

O<strong>per</strong>ation = c data present?<br />

Description = It is checked if the client exists.<br />

Reads = supplied cd : CData<br />

93<br />

client : Client with client.clientData = cd<br />

Changes = –<br />

Sends = Employee:{c data present!(client.nr),<br />

Pre = —<br />

c data not present!}<br />

Post = exists client : Client with client.clientData = cd<br />

⇒ is sent{c data present!(client.nr)}<br />

otherwise: is sent{c data not present!}<br />

=⇒ The class Client belongs to the system and has the attributes<br />

clientData and nr.<br />

95<br />

O<strong>per</strong>ation schemas for the insurance agency<br />

O<strong>per</strong>ation = enter c data<br />

Description = Data of a new client is entered.<br />

Reads = supplied cd : CData<br />

Changes = new client: Client<br />

Sends = Employee : {c data entered(cl nr)}<br />

Pre = not exists client : Client with client.clientData = cd<br />

Post = client.clientData ′ = cd<br />

client.nr ′ = cl nr, where cl nr is an new client number<br />

is sent{c data entered(cl nr)}<br />

94<br />

96


USE CASE “PREPARE APPLICATION/CONTRACT”, COMBINED<br />

FRAGMENTS<br />

sd EnterClientData<br />

Employee<br />

c_data_present?<br />

alt<br />

[cdp] c_data_present!<br />

[else]<br />

c_data_not_present!<br />

enter_c_data<br />

c_data_entered<br />

: Agency<br />

sd PrepareAppl/Contr<br />

Employee<br />

ref EnterClientData<br />

alt<br />

[ok]<br />

[else]<br />

97<br />

prepare_application<br />

application_prepared<br />

contract_prepared<br />

contract_not_prepared<br />

: Agency<br />

Pre = exists client : Client with client.nr = cl nr<br />

coregion<br />

check_application<br />

application_accepted<br />

application_not_accepted<br />

CentralOffice<br />

Post = application.nr ′ = app nr, where app nr new appl. number<br />

prod = car ⇒<br />

application.applicationData ′ =<br />

generate application(client.clientData,<br />

al.productData, al.alData, a data)<br />

ForAppl ′ = ForAppl ∪{(application, al)}<br />

prod = liability ⇒<br />

application.applicationData ′ =<br />

generate application(client.clientData,<br />

pl.productData, pl.plData, a data)<br />

ForAppl ′ = ForAppl ∪{(application, pl)}<br />

99<br />

O<strong>per</strong>ation = prepare application<br />

Description = An application for a known client is prepared.<br />

Reads = supplied cl nr : CNr<br />

supplied prod : Prod ID<br />

supplied a data : applicationData<br />

client : Client with client.nr = cl nr<br />

hi, al, pl : Product<br />

Changes = new application : Application<br />

PreparesAppl, ForAppl<br />

Sends = Employee: {application prepared(app nr)},<br />

CentralOffice:{check application(prod,<br />

application.applicationData ′ , app nr, client.clientData)}<br />

prod = health ⇒<br />

98<br />

application.applicationData ′ =<br />

generate application(client.clientData,<br />

hi.productData, hi.hiData, a data)<br />

ForAppl ′ = ForAppl ∪{(application, hi)}<br />

PreparesAppl ′ = PreparesAppl ∪{(client, application)}<br />

is sent{application prepared(app nr)}<br />

is sent{check application(prod, application.applicationData ′<br />

100<br />

app nr, client.clientData)}


CONSEQUENCES FOR THE SYSTEM CLASS MODEL<br />

• The class Application gets the attributes applicationData and nr<br />

• The association PreparesAppl should be part of the system. Therefore, it<br />

must be transformed into a binary relation, because Employee is an actor.<br />

• The classes HI, AL and PL, respectively, get attributes that contain<br />

product-specific information.<br />

FURTHER REMARK<br />

• The function generate application is an internal function that computes the<br />

application data from its inputs. It will not be specified any further.<br />

Pre = exists application : Application with<br />

application.nr = app nr<br />

Post = contract.nr ′ = c nr<br />

contract.contractData ′ = c data<br />

ForAppl ′ = ForAppl \{(application, product)}<br />

101<br />

PreparesAppl ′ = PreparesAppl \{(client, application)}<br />

RefersTo ′<br />

= RefersTo ∪{(contract, client, product)}<br />

is sent{contract prepared(c nr)}<br />

103<br />

O<strong>per</strong>ation = application accepted<br />

Description = An application is accepted by the central office and transformed<br />

into a contract.<br />

Reads = supplied app nr : Appl nr<br />

supplied c data : Contract Data<br />

supplied c nr : Contract Nr<br />

client : Client with (client, application) ∈ PreparesAppl<br />

product : Product with (application, product) ∈ ForAppl<br />

Changes = new contract : Contract<br />

delete application : Application with<br />

application.nr = app nr<br />

PreparesAppl, ForAppl, RefersTo<br />

Sends = Employee: {contract prepared(c nr)}<br />

REMARKS<br />

102<br />

• We assume that the contract number is determined by the cental office.<br />

• The class Contract must have the attributes nr and contractData.<br />

• The associations PreparesAppl and ForAppl must be unique and total, i.e.<br />

for each application there is exactly one client or one product, respectively,<br />

that is a member of the relation PreparesAppl or ForAppl, respectively.<br />

Then, it follows that the precondition “exists application : Application with<br />

application.nr = app nr suffices to uniquely determine client : Client and<br />

product : Product.<br />

• The association RefersTo is completely contained in the system. Moreover,<br />

for each contract, there is exactly one product and exactly one client such<br />

that these belong to the relation RefersTo.<br />

104


O<strong>per</strong>ation = application not accepted<br />

Description = An application is rejected by the central office.<br />

Reads = supplied app nr : Appl nr<br />

client : Client with (client, application) ∈ PreparesAppl<br />

product : Product with (application, product) ∈ ForAppl<br />

Changes = delete application : Application with<br />

application.nr = app nr<br />

PreparesAppl, ForAppl<br />

Sends = Employee: {contract not prepared(app nr)}<br />

Pre = exists application : Application with application.nr = app nr<br />

Post = ForAppl ′ = ForAppl \{(application, product)}<br />

THE SYSTEM CLASS MODEL<br />

PreparesAppl ′ = PreparesAppl \{(client, application)}<br />

is sent{contract not prepared(app nr)}<br />

105<br />

➠ Shows the classes to be implemented.<br />

➠ Is developed from a part of the class model.<br />

➠ Is delineated by a dashed line.<br />

➠ Actors and non-implementable classes (e.g., <strong>per</strong>sons who do not directly<br />

interact with the system) do not belong to the system class model.<br />

➠ The interpretation of a class can change from “real object” to “data<br />

representation”.<br />

➠ Classes on the system border may be divided into internal and external<br />

classes.<br />

107<br />

OBJECT-ORIENTED ANALYSIS<br />

➠ Class model =⇒ Static aspects<br />

➠ Interface model =⇒ Dynamic aspects<br />

• Use case model<br />

• Scenarios<br />

• O<strong>per</strong>ation model<br />

• System class model<br />

• Life-Cycle model<br />

➠ Usually, additions to the class model are necessary by:<br />

106<br />

• attributes that are introduced when setting up the o<strong>per</strong>ation model<br />

• “communication classes” for actors, i.e., classes that receive the system<br />

o<strong>per</strong>ations (see OOD)<br />

➠ The system class model is a well-formed class model, i.e., an association<br />

only belongs to it if all concerned classes are inside the system.<br />

108


EXAMPLE<br />

class model<br />

Checking<br />

Schufa<br />

Bank<br />

Queries<br />

Owns<br />

Customer Account<br />

REMARKS<br />

Keeps<br />

Works_for<br />

Savings Credit<br />

BankClerk<br />

LoanEx<strong>per</strong>t<br />

Customer<br />

109<br />

system class model<br />

Owns<br />

Checking<br />

Schufa<br />

Bank<br />

Account<br />

Queries<br />

Keeps<br />

number<br />

customer_data<br />

balance<br />

Savings Credit<br />

Works_for<br />

BankClerk<br />

LoanEx<strong>per</strong>t<br />

• We have decided that offers, applications, contracts and clients should be<br />

part of the agency. Each class of the system class model should have a<br />

relation to the agency (at least indirectly), because the agency constitutes<br />

the system to be implemented.<br />

• How the part-of relations exactly look like will result from the reference<br />

model to be constructed in the design phase.<br />

• Associations from the class model that have an actor as a participant have<br />

been eliminated from the system class model, or have been transformed<br />

into an association without a participating actor.<br />

• Instead, the actors have got an association to the agency.<br />

111<br />

SYSTEM CLASS MODEL FOR INSURANCE AGENCY<br />

Client<br />

clientData<br />

nr<br />

1<br />

Application<br />

PreparesAppl<br />

applicationData<br />

nr<br />

ForAppl<br />

PreparesOffer<br />

1<br />

Offer<br />

offerData<br />

Product<br />

productData<br />

ForOffer<br />

HI AL PL<br />

hiData alData plData<br />

OBJECT-ORIENTED ANALYSIS<br />

➠ Class model =⇒ Static aspects<br />

1<br />

1<br />

RefersTo<br />

110<br />

Employee CentralOffice<br />

Contract<br />

contractData<br />

nr<br />

➠ Interface model =⇒ Dynamic aspects<br />

• Use case model<br />

• Scenarios<br />

• O<strong>per</strong>ation model<br />

• System class model<br />

• Life-Cycle model<br />

112<br />

WorksFor IsConncectedTo<br />

1<br />

Agency<br />

InsuredEvent<br />

Concerning<br />

Report<br />

repData<br />

HI−Event<br />

Ex<strong>per</strong>tAdvisor<br />

Prepares<br />

1<br />

AL/PL−Event<br />

eventData<br />

nr<br />

regulation<br />

Authorizes


LIFE-CYCLE EXPRESSIONS<br />

The Life-Cycle model<br />

Expressions over the alphabet: 〈system o<strong>per</strong>ation〉, #〈output event〉<br />

113<br />

Each system o<strong>per</strong>ation and each expression of the form #〈output event〉 is a<br />

life-cycle expression.<br />

If x and y are life-cycle expressions then so are<br />

x;y x is followed by y<br />

x | y either x or y<br />

x∗ x is executed 0 or more times<br />

x + x is executed at least once<br />

[x] x is optional<br />

x || y x and y are executed concurrently<br />

O<strong>per</strong>ator precedences: [], ∗ , + , ;, |, ||<br />

115<br />

PURPOSE<br />

➠ describe the overall behavior of the whole system or describe the life-cycle<br />

of important objects<br />

➠ restrict the order in which the system o<strong>per</strong>ations may be invoked<br />

➠ Notation:<br />

• Fusion: life-cycle expressions<br />

• UML: state machine diagrams<br />

Definitions: name = life-cycle expression<br />

name can then be used in other life-cycle expressions (but recursion is not<br />

allowed!)<br />

114<br />

Rule:<br />

All system o<strong>per</strong>ations and all output events must occur in the life-cycle model!<br />

116


EXAMPLE: BANK<br />

Life-Cycle Bank system:<br />

Openacc;(Transaction|Query|Openacc) ∗<br />

Openacc = OpenaccNC | OpenaccKC<br />

Query = query balance;#current balance<br />

Transaction = deposit money | Withdrawal<br />

OpenaccNC = open new customer account;<br />

(Schufaquery|#customer already known)<br />

OpenaccKC = open known customer account;<br />

(#account opened|#account not opened)<br />

Withdrawal = withdraw money;<br />

(#give money|#no cover)<br />

Schufaquery = #schufa query;<br />

(credit worthiness ok; #account opened)<br />

|(credit worthiness not ok;<br />

#account not opened)<br />

117<br />

LIFE-CYCLE MODEL AS STATE MACHINE<br />

➠ System o<strong>per</strong>ations as events<br />

➠ Output events as actions<br />

➠ Transitions between states: event / action<br />

Example: life-cycle of an account<br />

2<br />

1<br />

no account<br />

3<br />

5<br />

no account<br />

Schufa<br />

queried<br />

1: open_known_customer_account / #account_not_opened<br />

2: open_new_customer_account / #customer_arlready_known<br />

3: open_new_customer_account / #schufa_query<br />

4: open_known_customer_account / #account_opened<br />

5: credit_worthiness_not_ok / #account_not_opened<br />

4<br />

6<br />

119<br />

account<br />

without<br />

deposit<br />

7<br />

7<br />

8<br />

account<br />

with<br />

deposit<br />

7: query_balance / #current_balance<br />

8: deposit_money<br />

9: withdraw_money / #give_money<br />

10: withdraw_money / #no_cover<br />

8<br />

6: credit_worthiness_ok / #account_opened<br />

9<br />

10<br />

PROBLEM<br />

We can only express that some account must be opened before a transaction<br />

or query can take place. We cannot express that before a transaction or query<br />

on account X can take place, X must have been opened before.<br />

Alternative: Describe life-cycle of specific objects.<br />

Example: Lifecycle Account: Open | n Open<br />

Open = NewAcc; (query balance;#current balance) ∗ ;<br />

deposit money; (Transaction|Query) ∗<br />

n Open = (open new customer account;#schufa query<br />

credit worthiness not ok;#account not opened)<br />

|(open new customer account;#customer already known)<br />

|(open known customer account;#account not opened)<br />

NewAcc = open new customer account;#schufa query;<br />

credit worthiness ok;#account opened |<br />

open known customer account;#account opened<br />

LIFE-CYCLE MODEL FOR INSURANCE AGENCY<br />

Summary of system o<strong>per</strong>ations and their output events:<br />

118<br />

Upd = update product;#product updated<br />

EntCDat = enter c data;#c data entered<br />

Query = c data present?;<br />

(#c data present!|#c not data present!)<br />

Offer = prepare offer;#offer prepared<br />

Appl = prepare application;<br />

(#check application || #application prepared)<br />

Acc = application accepted;#contract prepared<br />

NAcc = application not accepted;#contract not prepared<br />

Chg = change contract;#confirm change<br />

ChY = change confirmed;#contract changed<br />

ChN = change not confirmed;#contract not changed<br />

120


Canc = cancel contract;#confirm cancellation<br />

CanY = cancellation confirmed;#contract canceled<br />

CanN = cancellation not confirmed;<br />

#contract not canceled<br />

HIEv = report HI event;#settle HI event<br />

HIOK = HI settlement ok;#HI event settled<br />

HINOK = HI settlement not ok;#HI event not settled<br />

ALPLEv = report AP/PL event;#authorize ex<strong>per</strong>t<br />

DelRep = deliver report; #report delivered<br />

ALPLOK = settle AP/PL event;#AP/PL event settled<br />

ALPLNOK = not settle AP/PL event;<br />

#AP/PL event not settled<br />

Top-Level-Behavior:<br />

121<br />

V 1 = Query ∗ || Upd + || QuerEnt +<br />

V 2 = Offer ∗ || Query ∗ || Upd ∗ || QuerEnt ∗<br />

V 3 = (Appl;NAcc) ∗ || Offer ∗ || Query ∗ || Upd ∗ || QuerEnt ∗<br />

V 4 = (Appl;Acc) + || Offer ∗ || Query ∗ || Upd ∗ || QuerEnt ∗<br />

V 5 = Offer ∗ || Query ∗ || Upd ∗ || QuerEnt ∗<br />

|| Contract ∗ || Change ∗ || Cancellation ∗ || Event ∗<br />

Lifecycle Agency:<br />

V 1; V 2; V 3; V 4; V 5<br />

123<br />

Definition of “business processes”:<br />

QuerEnt = c data present?<br />

; #c data not present! ; EntCDat<br />

Contract = Appl ; (Acc | NAcc)<br />

Change = Chg ; (ChY | ChN)<br />

Cancellation = Canc ; (CanY | CanN)<br />

HI Event = HIEv ; (HIOK | HINOK)<br />

AL/PL Event = ALPLEv ; DelRep ; (ALPLOK | ALPLNOK)<br />

Event = HI Event | AL/PL Event<br />

REMARKS<br />

122<br />

• It is always possible to enter client data, to query if client data are present, and<br />

to update products (V 1). However, before an offer can be prepared (V 2), at<br />

least one update and one entering of client data must take place (V 1).<br />

• Moreover, it is possible that applications are prepared which are rejected (V 3).<br />

• Before the full functionality of the agency is possible (V 5), at least one<br />

application must have been accepted (V 4).<br />

• The different business processes may be executed concurrently (o<strong>per</strong>ator ||).<br />

Note:<br />

The life-cycle model should not only consist of life-cycle expressions that reproduce<br />

the scenarios, because the scenarios do not contain all possible/ <strong>per</strong>mitted<br />

behavior. However, each scenario must be <strong>per</strong>mitted by the life-cycle model.<br />

124


4 Develop<br />

the<br />

o<strong>per</strong>ation<br />

model.<br />

Fusion <strong>OOA</strong><br />

Summary and Validation Checklist<br />

125<br />

1. Exactly the system o<strong>per</strong>ations occurring in the scenarios must be<br />

described.<br />

2. The entities mentioned in the Reads and Changes clauses are<br />

disjoint.<br />

3. In the supplied clause, only simple data types may occur, no objects<br />

can be supplied.<br />

4. All objects mentioned in the Changes clause belong to the system.<br />

5. The output events occurring in the Post clause are exactly the<br />

ones occurring in the Sends clause.<br />

6. The actors named in the Sends clause are the same as in the<br />

scenarios.<br />

7. All objects referenced in Pre and Post are contained in the Reads<br />

or Changes clauses.<br />

8. Post covers all cases exhibited in the scenarios.<br />

9. All objects that are changed in Post are contained in the Changes<br />

clause.<br />

127<br />

No. Phase Validation<br />

1 Develop the class<br />

model.<br />

2 Develop the use<br />

case model.<br />

3 Refine the use<br />

cases by scenarios.<br />

5 Develop the<br />

system class<br />

model.<br />

6 Develop<br />

life-cycle<br />

model.<br />

the<br />

1. All important notions of the application domain<br />

must occur in the class model.<br />

2. For all associations, their multiplicities must be<br />

given, if not *.<br />

The identified actors should occur in the class model.<br />

For each use case, there must be at least one scenario.<br />

The actors in the scenarios must be consistent<br />

with the use case diagram, i.e., there is an arrow<br />

from/to an actor in the scenario iff there is an association<br />

between the use case and the actor in the use<br />

case diagram.<br />

126<br />

1. The border of the system must be consistent with the<br />

use case diagram, i.e., actors and their associations<br />

are outside the system.<br />

2. Exactly the classes of the system class model must<br />

occur in some system o<strong>per</strong>ation.<br />

1. Exactly the system o<strong>per</strong>ations and output events occurring<br />

in the scenarios must occur in the life-cycle<br />

model.<br />

2. All scenarios must be <strong>per</strong>mitted according to the lifecycle<br />

model.<br />

3. The life-cycle model should establish the preconditions<br />

of the system o<strong>per</strong>ations, if possible.<br />

<strong>128</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!