Bài Giảng Phân tích thiết kế hướng đối tượng (phần 3) - Pdf 16

Domain Model
Domain Model
Lecture 3
Lecture 3
Hoa Sen University 1
Agenda
Agenda

Recap

Case Requirements

Elaboration process

Domain model

Introduction and definition

How to create a domain model
Hoa Sen University 2
Recap
Recap

Inception activities

Different types of requirements

Scenario & Use case

Writing Use Cases


around the squares of the board

Implement a start Up use case as necessary
to support the initialization needs of the
iteration

Two to eight players can play

A game is played as a series of rounds
Hoa Sen University 5
Case requirements
Case requirements

Monopoly (cont)

Play the game for only 20 rounds

After the dice are rolled, the name of the player and
the roll are displayed. When the player moves and
lands on a square, the name of the player and the
name of the square that the player landed on are
displayed.

In iteration-1 there is no money, no winner or loser, no
properties to buy or rent to pay, and no special
squares of any kind

Square name will be “Go”, “Square 1”, “Square 2”,
…“Square 39”
Hoa Sen University 6


Last only one week

Most actors, goals and use cases named

Most use cases written in brief format; 10-20% of the use cases are
written in fully dressed detail

Recommendations on what components to buy/build/reuse, to be
refined in elaboration

Technical proof-of-concept prototypes and other
investigations to explore the technical feasibility of
special requirements/

High-level candidate architecture and components
proposed – NOT necessary to be final or correct

Plan for the first iteration
Hoa Sen University 8
Process: on to Elaboration
Process: on to Elaboration

What happens in Elaboration

The core, risky software architecture is programmed
and tested

The majority of requirements are discovered and
stabilized

Domain models

Illustrates noteworthy concepts in a
domain

Drawn with UML class diagram

As with all things in an agile modelling and
UP spirit, a domain model is optional

Input

Problem Description, Use Cases, …

Output

A set of class diagrams
Hoa Sen University 11
Example
Example
Hoa Sen University 12
Register
Item
Store
address
name
Sale
date
time
Payment


A domain model is a visual representation of
conceptual classes or real-situation objects in a
domain.

Various names

conceptual models, domain object models, analysis object
models

A domain model is illustrated with a set of
CLASS DIAGRAMS in which no operations
(method signatures) are defined
Hoa Sen University 13
Domain models is a visual dictionary
Domain models is a visual dictionary

Domain model provides a conceptual
perspective

Domain objects or conceptual classes

Associations between conceptual classes

Attributes of conceptual classes

The information it illustrates could
alternatively have been expressed in plain
text
Hoa Sen University 14

date
time
print()
What are conceptual classes
What are conceptual classes

A conceptual class may be
considered in terms of

Symbol – words or images
representing a conceptual
class

Intension – the definition of
a conceptual class

Extension – the set of
examples to which the
conceptual class applies
Hoa Sen University 16
Sale
date
time
concept's symbol
"A sale represents the event
of a purchase transaction. It
has a date and time."
concept's intension
sale-1
sale-3

amount: Money
getBalance(): Money
Sale
date: Date
startTime: Time
getTotal(): Money
. . .
Pays-for
UP Domain Model
Stakeholder's view of the noteworthy concepts in the domain.
UP Design Model
The object-oriented developer has taken inspiration from the real world domain
in creating software classes.
Therefore, the representational gap between how stakeholders conceive the
domain, and its representation in software, has been lowered.
1
1
1
1
A Payment in the Domain Model
is a concept, but a Payment in
the Design Model is a software
class. They are not the same
thing, but the former inspired the
naming and definition of the
latter.
This reduces the representational
gap.
This is one of the big ideas in
object technology.

Use a category list

Identify noun phrases
Hoa Sen University 20
Use a category list
Use a category list

Use a conceptual class category list:

Physical or tangible objects
Register, Airplane

Specifications, descriptions of things
ProductSpecification, FlightDescription

Places
Store, Airport

Transactions
Sale, Payment, Reservation

etc. (see Table 9.1 for a fuller list)
Hoa Sen University 21
Noun Phrase Identification
Noun Phrase Identification

Noun Phrase Identification [Abbot 83]

Analyse textual description of the domain


model components
model components
Part of speech Model component Examples
Proper noun Instance Alice
Common noun Class Customer, toy
Doing verb Operation Buy, recommend
Being verb Inheritance Is a kind of, is one
of
Having verb Aggregation
(Composition)
Has, consists of,
includes
Modal verb Constraints Must be
Adjective attributes Attributes 3 years old
Hoa Sen University 24
Example: find and draw conceptual
Example: find and draw conceptual
classes
classes

Case study: POS Domain

Input

fully dressed use case model (excellent textual
description of the domain)

Iteration-1: success (cash-only) scenario of Process
Sale use case.


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status