I wouldn't use a model object as a backing bean because the backing bean
is intended to mediate between the model and view layers. You could
compose the backing bean with the model object instead to achieve your
objectives and also reduce the number of attributes/getters/setters in
your backing bean. Sometimes backing beans have to have component
instances. By keeping the Backing bean separate from the model object,
you can still do this as well as have listener and action methods.

-Richard
 

-----Original Message-----
From: Stephen More [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 27, 2007 6:13 AM
To: MyFaces Discussion
Subject: Re: Simple MyFaces and JDO example

"Classes need to be enhanced according to a JDO metadata specification
before they are used in a JDO environment." I used the jpox-maven-plugin
to bytecode enhance my model objects.

Why shouldn't you use a model object as a backing bean ?
A User model object will have:
      getFirstname
      setFirstname
      getLastname
      setLastname
      getCompany
      setCompany

A User view object (backing bean) will have:
      getFirstname
      setFirstname
      getLastname
      setLastname
      getCompany
      setCompany

This seems pretty redundant to me.

-Steve

On 9/27/07, Richard Yee <rye........om> wrote:
> Can you elaborate more on how you have 'enhanced' the object. You 
> shouldn't really be using a Model object as a view object(backing
bean).
>
> _Richard
>
> Stephen More wrote:
> > Does anyone have a simple myFaces and JDO example ( without spring )
?
> >
> > I have enhanced the object I wish to persist. But when I try to use 
> > that object as a backing bean I get:
> >
> > Exception sending context initialized event to listener instance of 
> > class org.apache.myfaces.webapp.StartupServletContextListener
> > java.lang.VerifyError:  class B overrides final method .
> >
> > Are enhanced objects not allowed to be managed beans ?
> >
> >
> > -Thanks
> > Steve More
> >
> >
> >
>
>

Reply via email to