You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by bob <to...@excite.com> on 2007/02/24 01:03:48 UTC
[S2] model driven versus domain object property
I'm trying to figure out what the differences, pros and cons, are between using the ModelDriven interface to expose a domain object to the data transfer of the framework and just putting a domain object on the action as a property.
For instance, if my domain object is Customer, what would be the consequences and benefits of using modelDriven with a getModel() that returns an instance of Customer, versus having a getCustomer() property on my action object?
_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2] model driven versus domain object property
Posted by Mark Menard <ma...@mjm.net>.
On 2/24/07 3:41 PM, "Dave Newton" <ne...@yahoo.com> wrote:
> Isn't that an issue with *any* session-based
> methodology?
Absolutely. It just amazes me how many people still run into it and are
baffled by the strange behavior.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2] model driven versus domain object property
Posted by Dave Newton <ne...@yahoo.com>.
--- Mark Menard <ma...@mjm.net> wrote:
> Be careful with the ScopedModelDriven method. Have
> you checked that it works with a user running two
> concurrent copies of your wizard, if you allow it?
> (Think tabbed browsing.)
Isn't that an issue with *any* session-based
methodology?
d.
____________________________________________________________________________________
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2] model driven versus domain object property
Posted by Mark Menard <ma...@mjm.net>.
On 2/23/07 7:31 PM, "Dave Newton" <ne...@yahoo.com> wrote:
> --- bob <to...@excite.com> wrote:
>> For instance, if my domain object is Customer, what
>> would be the consequences and benefits of using
>> modelDriven with a getModel() that returns an
>> instance of Customer, versus having a getCustomer()
>> property on my action object?
>
> The model is put on the stack so you can directly
> access its properties. ScopedModelDriven is handy as
> well; it allowed me to implement some minor wizard-y
> funtionality very easily. If your model changes the
> presentation side doesn't (except for property
> changes, obviously, and the Action may change).
>
> I liked it for ScopedModelDriven, although I
> discovered it after I had already implemented the
> exact same functionality in one of my apps :/
>
> I'd also like to know of any other advantages of
> ModelDriven; I've had the same question in the back of
> my mind for awhile.
Dave,
Be careful with the ScopedModelDriven method. Have you checked that it works
with a user running two concurrent copies of your wizard, if you allow it?
(Think tabbed browsing.)
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2] model driven versus domain object property
Posted by Dave Newton <ne...@yahoo.com>.
--- bob <to...@excite.com> wrote:
> For instance, if my domain object is Customer, what
> would be the consequences and benefits of using
> modelDriven with a getModel() that returns an
> instance of Customer, versus having a getCustomer()
> property on my action object?
The model is put on the stack so you can directly
access its properties. ScopedModelDriven is handy as
well; it allowed me to implement some minor wizard-y
funtionality very easily. If your model changes the
presentation side doesn't (except for property
changes, obviously, and the Action may change).
I liked it for ScopedModelDriven, although I
discovered it after I had already implemented the
exact same functionality in one of my apps :/
I'd also like to know of any other advantages of
ModelDriven; I've had the same question in the back of
my mind for awhile.
d.
____________________________________________________________________________________
Need a quick answer? Get one in minutes from people who know.
Ask your question on www.Answers.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org