Directory structure is just used for packaging.  So, you keep all your views 
together.  But when you think about it, views rarely contain their own data.

 

Likewise, commands are in commands, vo’s should all be in vo.

 

FYI, the default Cairngorm structure has commands and events at the same level 
as control, not inside of control

 

Jake Churchill
CF Webtools
11204 Davenport, Ste. 100
Omaha, NE  68154
 <http://www.cfwebtools.com> http://www.cfwebtools.com
402-408-3733 x103

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Jorge Maiquez
Sent: Thursday, August 06, 2009 10:42 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] cairngorm convention: vo or model?

 

  

Ok, so if I’m understanding you correctly, you don’t have a problem storing a 
VO in some part of the model (assuming that the VO is used for both transport 
and storage)?

 

In my Cairngorm project, the directory structure looks like this:

 

business

control

   commands

   events

model

view

vo

 

So if I do what you suggest, and allow for a VO to reside in the model, then 
the model will contain stuff that does not reside in the model directory, which 
feels kinda weird to me.

 

I know I’m being very fussy over something very trivial :-)

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of claudiu ursica
Sent: 06 August 2009 16:01
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] cairngorm convention: vo or model?

 







You are right, If your data is only transport stuff and then get rid of it it 
does not justify to put it in the model. If you need your data displayed in the 
view then your data will probably be in the model. It depends on your business 
case. The VO is just a name in the end... you can label a class with VO or not 
it is how you use it what matters. You can transport data with VO objects 
(classes with no methods) and put it inside other model classes (put a clone 
method inside that class to move data from VO). But in many cases this is not 
justified. For example you want to login, you get the username and pass form 
the textfield inside a VO. Attach that VO as a payload to the cairngorm event 
and send it to the server via command/delegate etc ... That is a case where you 
just transport data ... no need ot store it in the model ... If you get data 
from the server like some products and want to display them in the view, you 
can pu them in the model and use the model as a dataprovider for a list or 
whatever ...

C

 

  _____  

From: Jorge Maiquez <jmaiq...@yahoo.com>
To: flexcoders@yahoogroups.com
Sent: Thursday, August 6, 2009 4:50:14 PM
Subject: RE: [flexcoders] cairngorm convention: vo or model?

  

What about transient data? I was always under the impression that VO’s (or 
DTO’s or whatever they’re called) were more like throw-away objects: you use 
them to transfer data to/from a server, but that’s it.

 

So if I label something as being a VO (e.g. ConversationVO) , then I don’t 
expect to find that class in the “model” classpath because I am not storing 
data in it. Consequently, I would not expect my view to bind to it.

 

Does that make sense? I guess all I’m asking is: would you label something as 
being a VO and then bind your view to it?

 

Symantics, I know, but I’m trying to figure out whether I’m the only one who 
thinks it’s weird :-)

 

 

From: flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of claudiu ursica
Sent: 06 August 2009 14:23
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] cairngorm convention: vo or model?

 






Ultimately the data should be in the model, and the view binds to the model. 
However depending on your needs you could notify the view from the command 
using responders. Check the UM Cairngorm extensions for this.

HTH,
Claudiu

 

  _____  

From: Jorge Maiquez <jmaiq...@yahoo. com>
To: flexcod...@yahoogro ups.com
Sent: Thursday, August 6, 2009 3:07:15 PM
Subject: [flexcoders] cairngorm convention: vo or model?

  

I have a some doubts about implementing Cairngorm correctly (and I guess MVC in 
general). I’m trying to decide where to place some of my data 
storing/transferrin g classes, and I was wondering if anyone has any rules of 
thumb for this kind of thing.

 

These are the guidelines that I have been following until now:

 

1) the class only transfers data to/from a server: postfix “VO” and put it in 
the vo folder

2) the class only stores data for the local application: put it in the model 
folder

3) the class does both of the above: put it in the model folder (don’t postfix 
“VO”)

 

I’m working with someone who does (1) even when the class is never sent across 
the wire.

 

What’s the “right” way to do this? 

 

And also: I’ve read somewhere that VO’s should not contain any logic, and that 
you should be able to initialise all of its properties via the constructor. 
What do you think?

 

TIA!

-Jorge

 
















No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.392 / Virus Database: 270.13.45/2285 - Release Date: 08/06/09 
05:57:00

Reply via email to