[Arp] Difference between Value Objects and Models?

Davies, Grant M. grant.davies at nscorp.com
Tue Mar 21 08:24:00 PST 2006


I think we are in agreement keith.

The overall thing I was thinking is we pass VO's back and forth and transfer
objects or vo's its essentiallly the same thing :)

The reason I use wrappers is really for the status codes/messages so I can
have a standard way of finding out if my request was sucessful instead of
re-inventing it each time

So if you were not using transfer objects, you would have to polute your
value objects to have a "status" of some sort, for example lets suppose you
are getting a shopping car from the database into a value object to serve to
flash, the possible errors are 

1) invalid shopping cart id
2) database is down
3) user is had not been authenticated

Etc...

So if these status's are common to all transactions and you have a global
error list for your app for example :

1 server communication failure
2 database failure
3 user session expired

Then app specific status's

100 invalid shopping cart id
101 shopping cart empty
102 user not logged in
103 etc...

If you don't do this, I'm not sure how your app will gracefully handle the
"what ifs?"

Even in my small apps I use "wrappers" for example I've done a calendar for
an ampi-theater, its shows the events the theater will show on a calendar
grid and you can click an item in the calendar to get more info.  The
unknowns I have to solve

1) no data for month
2) database is down
3) remoting is down
4) remoting has timed out
5) invalid data in database

I may present a generic "the calendar is not available please try again
later" but I need to at least know about this issues and plan for them. For
example when you click on a calendar cell, it takes you to a detail page
whose url looks like this

http://company/eventDetails.asp?performanceId=12345

A detail swf in the html gets the performance id via flash vars from the
query string and queries the server for that performance, again I have the
following what ifs :

1) invalid performance id
2) database down
3) remoting is down
4) timeout on the request
5) invalid performance data for flash to display... (dates are wrong, the
description of an event is null when it shouldn't be... Etc...)

Anyway just some ramblings :)

Grant



-----Original Message-----
From: Arp-bounces at ariaware.com [mailto:Arp-bounces at ariaware.com] On Behalf
Of Keith Salisbury
Sent: Tuesday, March 21, 2006 11:01 AM
To: General List for Ariaware RIA Platform users and developers
Subject: Re: [Arp] Difference between Value Objects and Models?

Hey Grant,

I wasnt suggesting that we should go round telling people their doing things
wrong, but that said, as Rich has mentioned, precise terminology is
something very crucial especially in the early days adopting a new
technology.

Correct terminology is crucial in all programming, to ensure the semantics
are maintained correctly, and people are able to grasp the concepts quickly
and thoroughly.

I understand and agree with your distinction between the two types VO/TO,
however i do think thats only really the larger scale applications where
people would be "wrapping up" their VO's inside TO's - i mean if you were to
do that in the Aral's trunk version of
Arp3 for the Pizza example, to me, it would seem like overkill, violating
your KISS principal which i wholeheartedly agree with.

Its an area that, certainly for a learner Arper's, represents some abiguity.
Similarly the structure and contents of the models, and the boundaries of
the roles of controllers appear to suffer the same lack of clarity.

keith


On 3/16/06, Davies, Grant M. <grant.davies at nscorp.com> wrote:
> I think you are all getting caught up in terminology..
>
> A Value object can be a domain object, a value object can be a 
> transfer object. A value object can be a wrapper object, at least 
> ValueObject has been an accepted design pattern that everyone has been 
> using for a long time for the correct purpose, why try and invent/add 
> yet another term or tell people "value object" is wrong, or say "hey 
> they are not value objects, they are transfer objects".
>
> As long as you are using them in the correct way I don't believe 
> ValueObject is a bad thing and I think a good practice is KISS (Keep it
simple stupid).
>
> To me transfer objects are the wrappers and value objects contain 
> data, but I don't think it's a big deal to call them both ValueObjects 
> and I'm not going to tell someone they are doing it wrong by calling a
"transfer object"
> a value object.
>
> Grant
>

_______________________________________________
Arp mailing list
Arp at ariaware.com
http://ariaware.com/mailman/listinfo/arp_ariaware.com



More information about the Arp mailing list