Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you are unsure, then start with Classifiers, since it keeps the class hierarchy tidy, and you can always go back and make a class if you need to.

A Tidy Class Hierarchy & Maintaining Facets 

One disadvantage of having a lot of classes, where there are sets of classes, each corresponding to a different facet, is that the information in the facets is lost and the class hierarchy gets large. Compare:

Image AddedImage Added

Using classifier, the hierarchy is much simpler, and each facet is very explicit and easy to see, understand and evolve. If there were just lots of classes, it would be harder to keep track of the facets. 

Image Added

The restrictions on LoanContract tell you what the facets are.

Image Added

 

Then you can see the values of each facet:

Image Added

Image Added

 

All of this valuable domain information is hidden in the first approach. Perhaps there is a way to add it?

How to do it both ways

Let's say we decided to model LoanReason as a Classifier, and later we realize we really want it to be a class.  There will be a subclass of Classifier called LoanReason, and instances as we said above. Each instance corresponds to a type of loan, but now we will also create a class to represent the same thing.

...