[Arp] Difference between Value Objects and Models?
Davies, Grant M.
grant.davies at nscorp.com
Thu Mar 16 06:21:45 PST 2006
This is how I see the difference between a valueObject and a transfer
object.
a ValueObject is a domain object, it represents a piece of data on the
server, for example a customer, an order, an address, an event at a theater
etc..
A transfer object is a wrapper that contains one of more value objects.
I mentioned the yesterday that I user a ServiceRequestHeader and
ServiceResponseHeader for base classes for wrappers like GetCustomerOrder
and inside GetCustomerOrder there is a array of value objects of type Order.
my package structure right now is
arpx.transfer.ServiceRequestHeader
arpx.transfer.ServiceResponseHeader
// client packages
com.chastain.transfer.GetMonthDataRequest
com.chastain.transfer.GetMonthDataResponse
com.chastain.domain.CalendarEvent
com.chastain.domain.Performance
on the server I have almost the same structure.
The domain objects actually map to database rows (currently using
NHibernate) so contain real business data but the transfer objects are just
a way of passing groups of domain object and the status of the calls.
Personally I've always called the wrappers ValueObjects instead of
TransferObjects but I don't think the 'terms" are a big deal as long as long
as your Transfer or Value objects do not have behavior just values.
Cheers,
Grant
_____
From: Arp-bounces at ariaware.com [mailto:Arp-bounces at ariaware.com] On Behalf
Of Matt Brailsford
Sent: Thursday, March 16, 2006 7:57 AM
To: Arp at ariaware.com
Subject: Re: [Arp] Difference between Value Objects and Models?
Aral, Sorry to cross post but could you please offer your view about VO's in
the current post titled 'The right way to use VO/TO's '
I'm interested to know if VO's should only be used for transfering data, how
should data be held in model? Wouldn't the model contain collections of
VO's?
Many thanks
Matt
_____
From: "Keith Salisbury" <keithsalisbury at gmail.com>
Sent: 16 March 2006 07:48
To: "General List for Ariaware RIA Platform users and developers"
<Arp at ariaware.com>
Subject: Re: [Arp] Difference between Value Objects and Models?
I think the term "Transfer Object" is much better. Its far more
explicit about what the purpose of the object is.
We should all try to promote adoption of this term i believe as it
will make it easier for new comers to understand more quickly...
On 3/2/06, Aral Balkan wrote:
> Hi Regina,
>
> Perhaps the term "Value Object" is not as clear as "Transfer Object".
> Basically, the model should be where you keep the data and VOs/TOs are
> what you use when you want to transfer/move data to carry out a unit of
> business logic. The idea behind a VO is that it contains all the data
> necessary to carry out a specific unit of business logic.
>
> Both of them getting registered via the same class is actually
> confusing. I need to refactor that so that the name is more generic.
>
> hth,
> Aral
>
> _______________________________________________
> Arp mailing list
> Arp at ariaware.com
> http://ariaware.com/mailman/listinfo/arp_ariaware.com
>
--
keithsalisbury at gmail.com
_______________________________________________
Arp mailing list
Arp at ariaware.com
http://ariaware.com/mailman/listinfo/arp_ariaware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ariaware.com/pipermail/arp_ariaware.com/attachments/20060316/98fb77e6/attachment-0001.htm
More information about the Arp
mailing list