Mark,

> On page 51 they write:
> 
> "Backing beans have their uses, but they can also be abused.  
> You should not use the user interface components as a 
> repository for business data. If you use backing beans for 
> your forms, you should still use beans for business objects."


see David's answer and my comment here.

The comment on 51 is fine! Since you realy should *not*
use UI-components for data.

In J2EE-Patterns there are Objects called ValueObjects (or
TransferObjekts)
for transfer between the tiers. JSF is in Web-Presentation-Tier.

You have layers like this:

JSP-file containing JSF-Tags *refers* --> BackingBean
BackingBean *uses* TransferObjects ---> BusinessDelegate (uses what else
:-))

Your BackingBean (e.g. customer) has a method the is trigerd after
*submit* (e.g. buttonPressed...)
like:
public String buttonPressed(){

 CustomerDataTransferObject dto = new ...();
 //copy properties for *this* to dto
 j2eeBusinessDelegate.storeCustomer(dto);
...
...
}


HTH,
Matthias

> 
> -Mark
> 

Reply via email to