Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

am I using my formbean appropriately?
Hi,

I'm developing a web app and using struts for my view and controller.
I'm new to J2EE and was wondering if it's considered appropriate to
pass my action forms on to my model layer.  Form beans in struts I
think are considered part of my view.

On the model side, I have entity beans that contain other beans and
sometimes collections of other beans.  My form bean contains ID values
to represent these collections of beans within beans.  In other words,
I can't just call beanutils.copyproperties().  I am not using nested
beans for good reason.  So I'd like to create a similar functionality
to copy over the properties in my model.  My only hesitation in
passing the formbean over is that it may be considered bad form,
because formbeans are considered part of the view, and that makes my
model unusable for other apps (though I'm not expecting to use other
apps).  Anybody have any words of wisdom to impart on an MVC novice
such as myself?

Report this thread to moderator Post Follow-up to this message
Old Post
Dan Hicks
10-24-04 08:56 PM


Re: am I using my formbean appropriately?
Dan Hicks wrote:
> Hi,
>
> I'm developing a web app and using struts for my view and controller.
> I'm new to J2EE and was wondering if it's considered appropriate to
> pass my action forms on to my model layer.  Form beans in struts I
> think are considered part of my view.

You are correct, beans that extend ActionForm are part of the view. The
model should have no knowledge of these, so it's not (IMO) a good idea
to pass form beans to the model. Your saving grace in struts is going to
be the action classes, as you can use these to take the properties of
your form beans and pass massage them into the form your model needs.
This is my understanding of the 'C' in MVC pattern - you control the
interaction between the model and the view. I stand to be corrected,
however, as I'm an MVC n00b meself.

Tiff
--
Chris M Soanes: Sailor, Windsurfer, Cyclist, Biker, Snowboarder,
Swimmer, Dog Owner, and above all, G.


Report this thread to moderator Post Follow-up to this message
Old Post
Chris Soanes
10-26-04 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Beans archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:52 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.