Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #12881

Re: Hairy generics question

Date 2012-03-11 18:20 -0400
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Hairy generics question
References (10 earlier) <jjfsic$8rc$1@news.albasani.net> <4f5b8978$0$283$14726298@news.sunsite.dk> <jjg43j$pj3$1@news.albasani.net> <4f5b9ced$0$282$14726298@news.sunsite.dk> <EY47r.49851$rS.970@newsfe15.iad>
Message-ID <4f5d2526$0$293$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


On 3/11/2012 1:06 PM, Arved Sandstrom wrote:
> On 12-03-10 02:26 PM, Arne Vajhøj wrote:
>> On 3/10/2012 12:47 PM, Lew wrote:
> [ SNIP ]
>
>>> Whether "JSF is MVC" now sounds like a style issue as I integrate your
>>> information. I'm in the habit of writing JSF backing beans more like a
>>> controller and less like a model-aware component, and your experience
>>> reveals a style with less rigorous a separation. I suggest that while
>>> JSF admits of a non-MVC approach, as you say, one should yet design
>>> along MVC lines.
>>
>> How do you write a managed bean with only control without form fields
>> properties?
>>
> You may have lost sight of the forest for the trees, Arne. :-)

That happens frequently.

:-)

>                                                                 It's
> quite simple, you just write your form EL such that "properties" (input
> texts, labels, checkboxes etc) point at one managed bean, and form
> actions point at another managed bean.

But then you would need to send over the first managed beans as argument
to the second managed bean.

I don't like that.

 >        If one did want to actually code like this, it can be done
 > cleanly in JSF 2.0 with @ManagedProperty or in CDI with @Inject -
 > provided that one is cognizant of scopes you can @Inject your backing
 > bean into the controller bean, and so your action method has clean
 > access to the backing bean form "properties" via accessors.

Ah.

That would make it useful.

> The ICEDFaces dev team makes these distinctions (see
> http://blog.icesoft.org/blojsom/blog/default/2009/04/23/Making-distinctions-between-different-kinds-of-JSF-managed-beans/)
>
> Using their names we see that the one bean I mention above is what they
> call a "backing managed bean", and the other is a "controller managed bean".

If one want true MVC in JSF that is probably the way to go.

> Most people don't split forms JSF code like this - *I* don't -

Neither does the Java EE tutorial or a common book like Core JSF.

Arne

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Hairy generics question Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-28 09:46 -0800
  Re: Hairy generics question Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-28 09:49 -0800
  Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-02-28 12:45 -0800
  Re: Hairy generics question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-02-29 19:37 -0400
    Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-02-29 22:32 -0800
      Re: Hairy generics question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-09 21:33 -0500
        Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-03-10 07:38 -0800
          Re: Hairy generics question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-10 12:45 -0400
          Re: Hairy generics question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-10 12:03 -0500
            Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-03-10 09:47 -0800
              Re: Hairy generics question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-10 13:26 -0500
                Re: Hairy generics question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-11 14:06 -0300
                Re: Hairy generics question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-11 18:20 -0400
  Re: Hairy generics question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-09 21:43 -0500

csiph-web