Re: Description Conceptual Classes
From: H. S. Lahman (h.lahman_at_verizon.net)
Date: 06/20/04
- Next message: Shayne Wissler: "Re: My Enterprise Architecture - your thoughts?"
- Previous message: Roger L. Cauvin: "Re: Description Conceptual Classes"
- In reply to: Bala Paranj: "Description Conceptual Classes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 20 Jun 2004 14:53:47 GMT
Responding to Paranj...
> This question is related to objects which are descriptions of other
> objects. For example TicketDescription class for a Ticket Entity
> class.
>
> Description conceptual class actually deals with data normalization
> and persistency issues. In this case we are talking about solution
> domain issues. These issues are not the concern of the analysis phase.
> These issues are addressed during the design or is it implementation
> phase?). The main purpose of the domain model is to show the most
> important conceptual classes in the problem domain.
Unfortunately terms like 'domain model' and 'analysis phase' mean
different things to different methodologies. Your domain model sounds
like a classic OOA solution for functional requirements. Is that correct?
>
> Therefore, my opinion is that the domain model should not have any
> description conceptual classes. This does not lead to loss of any
> information while communicating with the stakeholders since they are
> not knowledgeable in solution
> domain concepts.
Your 'description classes' sound a like what as commonly known as
specification classes. Specification classes are dumb data holders that
parametrically influence the results of executing generic behaviors in
other objects.
Specification classes represent a form of parametric polymorphism that
is very powerful. In particular, they allow one to encode invariants of
behavior in the software while allowing detailed differences to be
specified by data. As such they definitely belong in the OOA model
because, as Cauvin points out, they describe critical problem concepts
in a generic way.
For example, asset depreciation can be described as a GoF Strategy pattern:
* amortizes 1
[Asset] ---------------------- [Depreciation]
+ baseValue + compute (value, period)
+ periodCount
A
|
+--------------+-------...
| |
[Linear] [DoubleDeclining]
where each [Depreciation] subclass encodes a particular formula for
computing depreciation in a particular accounting period for Asset's
base value. The problem here is that depreciation formulas change over
tome as do the policies for assigning formulas to assets. To do either
of those things one needs to modify the [Depreciation] classes and the
implementation of whoever instantiates the relationship with [Asset].
A more elegant solution employing parametric polymorphism is:
* specifies 1
[Asset] ---------------------- [DepreciationSpec]
+ type + type
+ baseValue + periodCount
+ compute (period) + pctOfBase [periodCount]
This takes advantage of the invariant that any depreciation amount is a
percentage of the Asset's baseValue in each accounting period and that
percentage if fixed for all assets using the same formula. So [Asset]
can compute depreciation via:
value = this.baseValue * myDepreciationSpec.pctOfBase[period] * 100
in a generic fashion in all cases, regardless of what the actual formula is.
Now [DepreciationSpec] is a dumb data holder for parametric values and
its instances can be initialized from an external configuration file by
computing the formulas once outside the application. In addition, the
rules and policies for selecting the right formula can also be defined
externally by providing pairs of values of Assert.type and
DepreciationSpec.type. That allows a Factory to instantiate the
relationship at startup so that each Asset gets the right formula.
The big advantage here is that one can change the formula assignments,
add new formulas, and modify formulas without touching the code itself.
That can all be done in the external configuration data.
*************
There is nothing wrong with me that could
not be cured by a capful of Drano.
H. S. Lahman
hsl@pathfindermda.com
Pathfinder Solutions -- Put MDA to Work
http://www.pathfindermda.com
(888)-OOA-PATH
- Next message: Shayne Wissler: "Re: My Enterprise Architecture - your thoughts?"
- Previous message: Roger L. Cauvin: "Re: Description Conceptual Classes"
- In reply to: Bala Paranj: "Description Conceptual Classes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|