You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Clément Maignien <c....@edic-syliance.com> on 2005/09/02 10:24:16 UTC

RE : Which class to prepare database data to be displayed in JSF components

True true ... I'm only asking questions to get some advices.
So according to you It could be done in ManagedBeans or ActionBeans ?
Do you agree when I say it could not be done in DAO and Service objects ?

Thx
Clément

-----Message d'origine-----
De : Martin Marinschek [mailto:martin.marinschek@gmail.com] 
Envoyé : vendredi 2 septembre 2005 10:04
À : MyFaces Discussion
Objet : Re: Which class to prepare database data to be displayed in JSF components


Hold on - classic MVC allows UI Data to access the model...

why should that be disallowed?

regards,

Martin

On 9/2/05, Clément Maignien <c....@edic-syliance.com> wrote:
>  
> Hi everyone,
> Here is the situation : 
> I have to display in JSF components data (what ever it is) that come from a
> database (what ever it is). 
>   
> Which class is supposed to format data so it can be displayed in JSF 
> component ? For example in some SelectItem objects.
>   
> According to me, the DAO souldn't do that as it is done in the MyFaces 
> Wiki page http://wiki.apache.org/myfaces/HibernateAndMyFaces in the 
> last example, because it links data model to UI. The services (Spring 
> for example) classes shouldn't do that either as the service could be 
> called by WebService or RMI for a Swing application for example.
> It could be done ManagedBean class (Form Bean), but this time it links UI
> data to model Data. 
> So in my opinion this should be done BeanAction class, am I wrong ? 
>   
> Thx for your support.
> Clément. 
>   
>  
>  
>  
> 
>  


-- 

http://www.irian.at
Your JSF powerhouse - 
JSF Trainings in English and German

Re: RE : Which class to prepare database data to be displayed in JSF components

Posted by Werner Punz <we...@gmx.at>.
Btw... thanks, I am glad that people actually are reading
this small article...

I definitely would love to get more feedback on what is wrong
so that the article can become better over time
(feel free to edit yourself as well)

Werner


Clément Maignien wrote:
> True true ... I'm only asking questions to get some advices.
> So according to you It could be done in ManagedBeans or ActionBeans ?
> Do you agree when I say it could not be done in DAO and Service objects ?
> 
> Thx
> Clément
> 


Re: RE : Which class to prepare database data to be displayed in JSF components

Posted by Werner Punz <we...@gmx.at>.
I agree a SelectItems mapper does not belong into the DAO,
if you want total abstraction, which a dao should give...
(I will correct that in the article tomorrow)
having a selectitemdao is a bad approach for total abstraction...



Werner





Martin Marinschek wrote:
> Right - managedBeans as forms or actions.
> 
> I wouldn't code it in DAO or Service Objects.
> 
> Thing is - SelectItems introduces a dependency on the JSF library, so
> if you want to change your GUI layer, you shouldn't introduce this. In
> fact, a concept like SelectItems would belong into the Java core,
> somewhere where both Swing and JSF can use it. With this in place,
> SelectItems might be a concept generic enough to use it deeper in your
> application stack than at the managed-bean level.
> 
> regards,
> 
> Martin
> 
> On 9/2/05, Clément Maignien <c....@edic-syliance.com> wrote:
> 
>>True true ... I'm only asking questions to get some advices.
>>So according to you It could be done in ManagedBeans or ActionBeans ?
>>Do you agree when I say it could not be done in DAO and Service objects ?


Re: RE : Which class to prepare database data to be displayed in JSF components

Posted by Martin Marinschek <ma...@gmail.com>.
Right - managedBeans as forms or actions.

I wouldn't code it in DAO or Service Objects.

Thing is - SelectItems introduces a dependency on the JSF library, so
if you want to change your GUI layer, you shouldn't introduce this. In
fact, a concept like SelectItems would belong into the Java core,
somewhere where both Swing and JSF can use it. With this in place,
SelectItems might be a concept generic enough to use it deeper in your
application stack than at the managed-bean level.

regards,

Martin

On 9/2/05, Clément Maignien <c....@edic-syliance.com> wrote:
> True true ... I'm only asking questions to get some advices.
> So according to you It could be done in ManagedBeans or ActionBeans ?
> Do you agree when I say it could not be done in DAO and Service objects ?
> 
> Thx
> Clément
> 
> -----Message d'origine-----
> De : Martin Marinschek [mailto:martin.marinschek@gmail.com]
> Envoyé : vendredi 2 septembre 2005 10:04
> À : MyFaces Discussion
> Objet : Re: Which class to prepare database data to be displayed in JSF components
> 
> 
> Hold on - classic MVC allows UI Data to access the model...
> 
> why should that be disallowed?
> 
> regards,
> 
> Martin
> 
> On 9/2/05, Clément Maignien <c....@edic-syliance.com> wrote:
> >
> > Hi everyone,
> > Here is the situation :
> > I have to display in JSF components data (what ever it is) that come from a
> > database (what ever it is).
> >
> > Which class is supposed to format data so it can be displayed in JSF
> > component ? For example in some SelectItem objects.
> >
> > According to me, the DAO souldn't do that as it is done in the MyFaces
> > Wiki page http://wiki.apache.org/myfaces/HibernateAndMyFaces in the
> > last example, because it links data model to UI. The services (Spring
> > for example) classes shouldn't do that either as the service could be
> > called by WebService or RMI for a Swing application for example.
> > It could be done ManagedBean class (Form Bean), but this time it links UI
> > data to model Data.
> > So in my opinion this should be done BeanAction class, am I wrong ?
> >
> > Thx for your support.
> > Clément.
> >
> >
> >
> >
> >
> >
> 
> 
> --
> 
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
> 


-- 

http://www.irian.at
Your JSF powerhouse - 
JSF Trainings in English and German