Re: Using one design class to manage each use case?

From: H. S. Lahman (h.lahman_at_verizon.net)
Date: 10/31/03


Date: Fri, 31 Oct 2003 19:57:49 GMT

Responding to Ken...

> Any opinions would be greatly appreciated!

In the shower this morning I had another insight into this than what I
already said on the subject. Alas, I like the idea of mapping controller
classes to use cases even less now. B-)

Assume that you are doing feature based incremental development and that
each of your features can be mapped into a single use case. So you
fully implement one use case at a time. What do you do when you
increment a new use case against an application that has already had
several implemented?

It seems to me that creating a new controller class for each use case
would tend to add clutter to the application. In addition, I would
expect it to introduce redundancy if the use case was similar to
previous use cases.

I would think a much more natural approach (from an OO perspective)
would be to abstract classes from the problem space initially and then
enhance them in each iteration by abstracting any new responsibilities
they might need. Then one would only need to add a class if the feature
needed a responsibility that was not logically associated with any of
the existing classes.

For example, consider the traditional banking customer transactions of
deposit, withdrawal, and balance check. That would be three use cases
but one can easily envision processing that only involved a Checking or
Savings Account class (assuming things like persistence and general
ledger functions were handled in other subsystems). Each of those
transactions would likely be a use case, but is there a need for more
than one Controller (Customer)?

I don't think so. OTOH, if the bank starts to allow stock market
transactions from an ATM, then that use case would probably require a
new class. But that class (e.g., Broker Account) would be abstracted
from the problem space based upon the needs of the new requirements to
be resolved (i.e., the traditional Checking Account and Savings Account
would be apples vs. oranges compared to Brokerage Account).

It seems to me that one of the goals of OO is to use abstraction, etc.
so that one can <later> easily modify /existing/ classes to deal with
changing requirements. If one maps use case = <unique> controller class
the intrinsic structure of the problem space gets shuffled aside for an
inherently hierarchical view of the use case as a sequence of
operations, which is a very procedural perspective.

*************
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.pathfindersol.com
(888)-OOA-PATH



Relevant Pages

  • Re: Where do business rules belong... OCP and SPs
    ... Responding to Levin... ... > modify my account balance, I want to save the original account ... I could argue that the reason one wants this is a form of data integrity ... >>The other problem is generating transactions against the DB. ...
    (comp.object)
  • Re: speed reading
    ... I had accidentally posted from my daughter's mothers' account ... You see, Dwight... ... I'm not responding to you because you're a jerk. ... Which, even if true, doesn't mean you are not dodging them. ...
    (rec.arts.sf.written)
  • Re: Please help - Cant join PC to new domain
    ... Thanks for responding. ... Tried creating the computer account first and then adding it to the ... Instead of the website you're using, I suggest to use OEx (Outlook Express ... This is a direct link to the Microsoft Public ...
    (microsoft.public.windows.server.dns)
  • Re: Factories and lazy objects
    ... Responding to Lahman: ... Dispatcher IS the controller. ... > mainframe be shielded from Account? ... shield the Account from the mainframe". ...
    (comp.object)
  • Re: The Vinland Maps Ink
    ... >> Your reminder is misplaced. ... First, I was responding ... >> "If the map is authentic, it must be possible to describe ... >> properties into account." ...
    (sci.archaeology)