On 5/28/07, Chris Murphy <chris@...> wrote:
>
> I find myself being confused by terms such as Business Object, Domain
> Object, POJO and Data Object. In many instances they all mean the same
> thing, right? Certainly the last three are all the same thing, I think.
I don't personally distinguish between Business and Domain objects,
but perhaps someone else has a distinction that is meaningful. As far
as I am concerned, the only difference is that a business person might
understand what you mean by a Business Object but they may have no
clue what you mean by Domain Object.
POJO, on the other hand, does have a particular meaning. As the name
"plain-old-java-object" suggests it is an object that is not strongly
coupled to a framework: i.e. not an EJB. This is orthogonal to whether
it is a Domain Object or a Data Object.
The distinction between Data Object and Domain Object is helpful - a
Domain Object is an object which takes on responsibility for
maintaining the consistency and integrity of its own state - it
encodes the "business" rules of the object, whereas a Data Object is
simply a container for data and doesn't have any logic associated with
it. Domain Objects generally have methods that do things other than
simply set and get its properties. Simple rule: Domain Objects usually
have non-trivial responsibilities, Data Objects don't.
Regards,
jon.