1. Trang chủ
  2. » Công Nghệ Thông Tin

THU THẬP YÊU CẦU HƯỚNG ĐỐI TƯỢNG ppt

33 209 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 33
Dung lượng 1,39 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Example Collaboration Diagrams1.1: *getAccountDetails:withdrawUI :withdrawCtrl Campaign Manager Allocation of responsibilities for use case withdraw 4.1.1: withdraw... Sequence Diagrams

Trang 1

Chương 3 THU THẬP YÊU CẦU

HƯỚNG ĐỐI TƯỢNG (cont)

Trang 2

Cơ chế truyền thông điệp của đối tượng

UML :Book sam:Student

getFineDue( )

Các đối tượng trao đổi thông tin thông qua cơ chế

truyền thông điệp.

Gửi thông điệp getFineDue() đến đối tượng

Student thực hiện cú pháp sau:

fine = sam.getFineDue()

Trang 3

Interaction (sự tương tác) & Collaboration

The structure of Instances playing roles in a behaviour and their relationships is

called a Collaboration.

An Interaction is defined in the context of a Collaboration It specifies the

communication patterns between the roles in the Collaboration.

More precisely, it contains a set of partially ordered Messages, each specifying one

communication,

e.g what Signal to be sent or what Operation to be invoked, as well as the roles played by the sender and the receiver, respectively.

Trang 4

Example Collaboration Diagrams

1.1: *getAccountDetails():withdrawUI :withdrawCtrl

Campaign

Manager

Allocation of responsibilities for use case withdraw

4.1.1: withdraw()

Trang 5

Sequence Diagrams

Show an interaction between objects arranged in a time sequence

Can be drawn at different levels of detail and to meet different

purposes at several stages in the development life cycle

Typically used to represent the detailed object interaction that occurs for one use case or for one operation

Trang 6

Sequence Diagrams

the page and represented by lifelines

Trang 7

Sequence diagram with entity objects only

:Card :Account

listAccounts()

withdraw()

*getAccountDetails( )

Object lifeline

Activation

Client

Trang 8

Sequence diagram with entity objects only

:Client :Campaign :Advert

getName()listCampaigns()

listAdverts()

*getCampaignDetails()

Advert()

*getAdvertDetails()

Trang 9

Boundary & Control Classes

*getAccountDetails():withdrawUI

:withdrawCtrl :Card :Account

withdraw()selectAccount()

withdraw()startInterface() listClient()

Client

Use Case: withdraw

Trang 10

Boundary & Control Classes

Trang 11

Object Destruction (hủy)

Trang 12

getOverheads()Campaign

Manager

Trang 13

May be shown by shading those parts of the activation rectangle that correspond to active processing by an operation

Trang 15

-< 6 sec}

Synchronous (blocking) message

Asynchronous message

Callback

Time

constraints

Construction marks to show time constrained interval

{e’ – e < 6 sec}

An active

object

Here e is used as shorthand for

e.sendtime and

e’ represents e.receivetime

Trang 16

Campaign

Manager

Trang 17

Handling Complexity

diagrams suitably annotated

single lifeline, and interaction among these objects is shown

on a different diagram

Trang 18

Handling Complexity

:AddAdvertUI

:AddAdvert

showClientCampaigns()selectClient()

These flows are continued next figurestartInterface()

*getClient()

Campaign

Manager

Trang 20

Object Grouping

Lifeline representing a set of objects

Trang 21

Collaboration Diagrams

Sơ đồ Cộng tác

Hold the same information as sequence diagrams

Show links between objects that participate in the collaboration

No time dimension, sequence is captured with sequence numbers

Sequence numbers are written in a nested style (for example, 3.1 and 3.1.1) to indicate the nesting of control within the interaction that is being modelled

Trang 22

Collaboration Diagrams

1.1: *getAccountDetails():withdrawUI :withdrawCtrl

Campaign

Manager

Allocation of responsibilities for use case withdraw

4.1.1: withdraw()

Trang 23

:Client :Campaign :Advert

3.1: showClientCampaigns()3: selectClient()

Campaign

Manager

One allocation of responsibilities for use case

Add a new advert to a campaign

Trang 24

:Client :Campaign

:Advert

3.1: showClientCampaigns()3: selectClient()

4: selectCampaign() 4.1: showCampaignAdverts()

4.1.1: listAdverts()5: createNewAdvert() 5.1: addNewAdvert()

newAd:Advert

2: startInterface()

3.1.1: listCampaigns()1:*getClient()

Campaign

Manager

Alternative allocation of responsibilities for use case Add a new advert to a campaign

Trang 25

Message

Simple message 4: addNewAdvert()

Nested call with return value.

The return value is placed in the variable name.

3.1.2: name:= getName()

Conditional message.

This message is only sent if the condition [balance > 0] is true.

concurrent messages 3.1a and

3.1b are completed.

3.1a, 3 1b / 4:playVideo()

Trang 26

Activity Diagrams

other uses

technique

Trang 27

Link to CreativeStaff

Create new

StaffGrade

Link to previous StaffGrade

Set previous StaffGrade gradeFinishDate

Simple Activity Diagram

Trang 28

Check approval for grade change

Create new StaffGrade

Link to previous StaffGrade

Set previous StaffGrade gradeFinishDate

Activity Diagram with Selection

Trang 29

Add to ‘star’ list

Create warning letter

[bonus < £25]

[bonus >= £25 AND bonus <= £250]

Activity Diagram with Selection and

Iteration

Trang 30

Get Account Details

[NoOfAccounts = 1]

[amount < =A balance]

A.balance  A.balance-amount Result  TRUE

List an Account details

A  Only Account

Activity Diagram- Withdraw

Trang 31

Object Constraint Language

Most OCL statements consist of:

Context, Property and Operation

Context

Defines domain within which expression is valid

Instance of a type, e.g object in class diagram

Link (association instance) may be a context

A property of that instance

Often an attribute, association-end or query operation

Trang 32

Arithmetical operators *, +, - and /

Set operators such as size, isEmpty and select

Type operators such as oclIsTypeOf

Trang 33

OCL expression Interpretation

Person

self.gender

In the context of a specific person, the value of the property ‘gender’ of that person—i.e a person’s gender.

Person

self.savings >= 500

The property ‘savings’ of the person under consideration must be greater than or equal to 500.

Company

self.CEO->size <= 1

The size of the set of the property ‘CEO’

of a company must be less than or equal to 1 That is, a company cannot have more than 1 Chief Executive Officer.

Company

self.employee->select (age < 60)

The set of employees of a company whose age is less than 60.

Ngày đăng: 13/08/2014, 20:22

TỪ KHÓA LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm

w