See if this methodology helps you separate the 2.
When I start a project.... I do not care about DB or model; I only care what the client wants, like what fields, where, etc.


I work w/ them to create html mock ups as requirments.
Is this what they want?
Once that's done, it's easy.
I rename HTML to jsp and write Struact actions to get to each of the said JSPs
Then I write formbeans (since I know html fileds, I know get/set :-) ; nothing w/ model).
Now I have a prototype where I validate... is this what you want?
( See, no model. )


If yes... I design CURD of DAO and model (sometimes E/R, sometimes I have to get data from various existing dbs) in a way to populate or save my form beans fields..
I unit test the DAO's CRUD outside of container and outside of Struts. If it does not CRUD here ... it won't start working once I put it in Struts.
The 2 are as separate as possible. The CRUD might be simple or complex; I assume the client does not care, as long as they get what they want.
Only then do I integrate the 2.


.V

Leandro Melo wrote:

Hi all.
This might seem more a design question than a struts
specific question. Anyway, if anyone could help me out
a little here.
I`m going to explain what is my approach for an
specific situation, then you tell me what you think
about that, ok.
When i`m designinig the web interface for a software,
i go something like this.
Suppose i have a table USER in database and also have
2 other tables that have relationships to this one.
They`re table USER_PROFILE and USER_ADDRESS.
I`m very used to build CRUD pages, so i usually go
with a design like this.
I got, for example, a UserCRUDPage, where the user can
set attributes like name, age, e-mail, etc... that
belong to the USER table in db. I also use something
like a navigation bar that in this specific case would
have 2 links, one for User Profile and other for User
Email.
This way, if the user wants to set/update his/her
address, he would just click on the link and go to the
AddressCRUDPage. The same thing would happen to
profile.
This design seems to be very nice to me.
Unfortunatelly, i had an experience last week that
made me think about that.
I had some Actions associated whith the updates. In
this case i had ActionUserUpdate,
ActionUserAddressUpdate and ActionUserProfileUpdate.
Naturally, this classes performed all the control
layer associated with those operations. It doesn`t
matter right now if the Actions are in diferent
classes or in the same one. If you want, you can think
that i actually had a DispatchActionUserCRUD for
example.
The "problem" started when my client decided that from
now on he would like to have the address operation
page in the same page of the user page. In this case i
had to mix the UserCRUDPage with the AddressCRUDPage
in only one page. My client also wanted that all the
data on the page could be updated with only one mouse
click (in other words, only one 'save' button).
Naturally, i was forced to make some small changes in
my pages (and it`s forms) and the associated Actions,
so now i need to a way of centralizing the operation
of both actions (User and Address). Briefly, i need to
make a few changes in my Action, that`s the point
here.
Although the changes were actually small, i started to
think that :

My view is coupled to my control layer, wich is even
more coupled with my domain model.

Well, i`m not talking about big coupling here, but it
exists. In other workds i`m saying that in more
abstract point of view, this is what happens.
I really would like to hear comments about this whole
thing...
Thanks for reading.




__________________________________ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250




--
Forums, Boards, Blogs and News in RiA <http://www.boardVU.com>


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to