The most effective tool for holding the parts together is a robust
UBIQUITOUS
LANGUAGE
that
underlies the whole heterogeneous model. Consistently applying names in the two environments
and exercising those names in the
UBIQUITOUS LANGUAGE
can help bridge the gap.
This is a topic that deserves a book of its own. The goal of this section is merely to show that it
isn't necessary to give up
MODEL-DRIVEN
DESIGN
, and that it is worth the effort to keep it.
Although a
MODEL-DRIVEN DESIGN
does not have to be object oriented, it
does
depend on having an
expressive implementation of the model constructs, be they objects, rules, or workflows. If the
available tool does not facilitate that expressiveness, reconsider the choice of tools. An
unexpressive implementation negates the advantage of the extra paradigm.
Here are four rules of thumb for mixing nonobject elements into a predominantly object-oriented
system:
Don't fight the implementation paradigm
. There's always another way to think about a
domain. Find model concepts that fit the paradigm.
Lean on the ubiquitous language
. Even when there is no rigorous connection between tools,
very consistent use of language can keep parts of the design from diverging.
Don't get hung up on UML
. Sometimes the fixation on a tool,
such as UML diagramming,
leads people to distort the model to make it fit what can easily be drawn. For example, UML
does have some features for representing constraints, but they are not always sufficient.
Some other style of drawing (perhaps conventional for the other paradigm), or simple English
descriptions, are better than tortuous adaptation of a drawing style intended for a certain
view of objects.
Be skeptical
. Is the tool really pulling its weight? Just because you have some rules, that
doesn't necessarily mean you need the overhead of a rules engine.
Rules can be expressed
as objects, perhaps a little less neatly; multiple paradigms complicate matters enormously.
Before taking on the burden of mixed paradigms, the options within the dominant paradigm should
be exhausted. Even though some domain concepts don't present themselves as obvious objects,
they often can be modeled within the paradigm. Chapter 9 will discuss the modeling of
unconventional types of concepts using object technology
The relational paradigm is a special case of paradigm mixing.
The most common nonobject
technology, the relational database is also more intimately related to the object model than other
components, because it acts as the persistent store of the data that makes up the objects
themselves. Storing object data in relational databases will be discussed in Chapter 6, along with
the many other challenges of the object life cycle.
[ Team LiB ]