cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Romayev <roma...@yahoo.com>
Subject Re: [cforms] Partial Binding
Date Sun, 27 Feb 2005 18:44:04 GMT
I'm sort of split on this one.  Would be interested in hearing other 
people's opinions/ideas.

There are pros and cons in doing this separation.  Technically if in a 
typical design you would almost need to have 3 layers of beans:

1. Form Beans - used to save forms to.
2. Business Beans.
3. Data Beans -used for data persistence by say OJB or in my case 
Hibernate.

The Form Beans are useful, as it is frequently not possible to have the 
business object model available during binding.  For example, it's a 
complex model and you are using the "Builder" pattern to properly 
create all the beans and their relationships or only part of the model 
comes from the user input and the rest from querying other systems, 
e.g. LDAP.

Business Beans provide a stronger model.  For example, you might not 
want to have getPassword() method on your User bean and have 
isValidPassword(String password) instead or not provide some of the 
setter methods to ensure immutability of some of your fields.

Hence, there is a need to have Data Beans, where each property has a 
gettter and a setter and this way can be mapped to database tables.

HOWEVER:

If I want to add an attribute I would need to change:
1. Database table
2. Object/relational mapping
3. Data bean
4. Business bean
5. Form bean
6. Form definition
7. Form binding
8. Potentially a betwixt mapping if you use the bean to stream out XML 
for you presentation
9. Various mapping methods, such as Form Bean to Business bean, etc

Bloody nightmare!!!


Thoughts?

-Alex


On Feb 27, 2005, at 12:58 PM, Jorg Heymans wrote:

>
>
> Alex Romayev wrote:
>> If I understand you correctly, then I'd need to look through the 
>> "form" beans, match them with the actual beans and the the values.  
>> Sort of defeats the purpose of using the binding in the first place?
>
> Why ? I find it good practice to have form beans as an extra layer 
> between the real "business" beans and the user.
>
>
> Jorg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message