Versions Compared

Key

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

The terms "business object" and "domain object" are
mutually exchangeable in common understanding in
enterprise computing. Note that wikipedia links
to the same article for both terms:

...

In re-motion, these terms are related, but not
mutually exchangeable. Important
differences exist, and this page clarifies these differences
and the precise meaning of each term.

Both business objects and domain objects are
collections of properties, modelled after the real-world
entities you want to manage with your application. For example,
if you want to manage people with your re-motion application, you
might want person objects. A toy person object
can consist of these (typed) properties:

...

To this vague explanation all enterprise programmers can
agree. What about the differences?

...

  • a domain object can persist its value in a database
  • a business object exposes an IBusinessObject interface,
    so that a binding layer can discover which properties constitute
    the (business object)

If we understand the Dr. Freud object listed above as a
business object, we know that we can use the IBusinessObject
interface to initiate a dialog like this:

...

After such a conversation, re-bind (or some other binding layer, that's the
beauty of it) knows everything it needs to display all of Dr. Freud's values
in a form or a list. That's the business object aspect of that instance,
and it is most important for re-bind.

If we understand the Dr. Freud object as a domain object, we can
be sure that it can load and store itself from and to some database.
That's the domain object aspect of that instance, and it is most
important for re-store.

Not all business objects are domain objects

Aren't all domain objects business objects? What's the point of a business
object that can't be persisted?

...

  • re-bind might bind to non-re-store objects (such implementations exist at rubicon)
  • re-store might be used in a command line tool that has no need for re-bind, because
    nothing is displayed (such programs do exist mainly for data migration or diagnostics)

"Search objects" expose an IBusinessObject interface, but are never persisted.
Like domain objects, they are sets of typed properties, but these properties are
search terms, not components of objects you want to manage. If you have person
objects in your application, it is a good idea to have person search objects as
well:

  • First Name = whatever
  • Surname = "Smith"
  • Title = Ph.D.
  • birth-date = before 1970-01-01

This search object represents a query that gives you all Ph.D.s named Smith who
are born before 1970. It exposes an IBusinessObject interface,

...

Conversely, domain objects DON'T expose an IBusinessObject interface.
If you want objects with persistence AND an IBusinessObject interface, you
must resort to bindable domain objects. BindableDomainObject is the base
class for all re-motion web applications, because they are domain objects (persistence)
AND business objects (can be displayed by re-bind).

...