Vous êtes sur la page 1sur 13

Implementation

model

1
• Implementation modeling
includes following steps

• Fine-tuning classes.
• Fine-tuning generalizations.
• Realize associations.
• Prepare for testing.

2
Fine-tuning
generalizations

• As we can reconsider classes, so too


we can reconsider generalizations.

• Sometimes it is helpful to remove a


generalization or to add one prior to
coding.

3
TranslationConce TranslationConcept
pt

Languag
Phrase
e Language Phrase
string
name name string

Majorlanguage Minorlanguage

4
Realizing Associations
• Associations are the “glue” of the
class model, providing access paths
between objects.
• Here we must formulate a strategy
for implementing them.
• Either we can choose a global
strategy for implementing all
associations uniformly, or we can
select a particular technique for each
associations. 5
Analyzing Associations
Traversal

• We have assumed until now that


associations are inherently
bidirectional, which is true in an
abstract sense.

• But if our application has some


associations that are traversed in
only one direction, their
implementation can be simplified. 6
One-way Associations

• If an association is traversed only in


one direction, we can implement it as
a pointer, an attribute that contains
an object reference.

• If the multiplicity is “one” then it is a


simple pointer; if the multiplicity is
”many”, then it is a set of pointers.
7
class model:

Person company

Implementation:

Person Company

Employer

8
Two-way Associations
Many associations are traversed in
both . directions. There are three
approaches to their implementations.

• Implement one-way.
• Implement two-way.
• Implement with an association
object.
9
• Implement two-way

Person Company

employer employees

Set

10
• Implement with an association object

:Person
WorksFor

:Person
:Compan
y

:Person

:Person :Compan
y

:Person

11
Advanced Associations
• The appropriate technique for
implementing advanced associations
are
• Associations classes.
• Ordered associations.
• Sequences.
• Bags.
• Qualified associations.
• N-ary associations.
• Aggregation.
• Composition.
12
Thank
you
13

Vous aimerez peut-être aussi