Re: Description Conceptual Classes

From: H. S. Lahman (h.lahman_at_verizon.net)
Date: 06/20/04


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



Relevant Pages

  • Re: Rental Property Depreciation / Home Office Depreciation
    ... deduction), I moved in January of 07 to a new home. ... My question relates to taking the depreciation on the home. ... take in account the depreciation portion of the home office deduction ... The home office asset would be taken out of service and ...
    (misc.taxes)
  • Re: polymorphism over switchcase statements
    ... Consider computing asset depreciation... ... The problem here is that Assets with different assetTypes use different formulas for computing depreciation from the baseValue. ... Here that's pretty obvious but if depreciation is part of some other activity the client invokes, just finding the right place might get tricky. ...
    (comp.object)
  • Re: Calculating Depreciation
    ... years accounts that had a Cost of 4498 (NBV ... just two separate rates for two separate classes of asset. ... then he wouldn't need separate cost and depreciation accounts ...
    (uk.business.accountancy)
  • Re: What If Analysis???
    ... Returns the depreciation of an asset for a specified period, ... double-declining balance method of some other method that is specified ... Excel and Word Function Lists available free to good homes. ...
    (microsoft.public.excel.worksheet.functions)