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


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

Re: Hairy generics question

From Arved Sandstrom <asandstrom3minus1@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: Hairy generics question
References (9 earlier) <4f5abd76$0$290$14726298@news.sunsite.dk> <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>
Message-ID <EY47r.49851$rS.970@newsfe15.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2012-03-11 14:06 -0300

Show all headers | View raw


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?
> 
> Arne
> 
You may have lost sight of the forest for the trees, Arne. :-) 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.

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".

They also assign - and this jibes with my classification of JSF bits
according to MVC - JSF actionListener and valueChangeListener methods to
the "backing bean" category.

Most people don't split forms JSF code like this - *I* don't - but there
is some merit to thinking about the distinction even if it's only
logical. 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.

AHS

-- 
Last week I helped my friend stay put. It's a lot easier'n helpin' 'em
move. I just went over to his house and made sure that he did not start
to load shit into a truck.
-- Mitch Hedberg

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


Thread

Re: Hairy generics question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-02-26 13:13 -0400
  What is Model View Presenter. (Was: Hairy generics question) Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-26 10:22 -0800
    Re: What is Model View Presenter. (Was: Hairy generics question) Lew <noone@lewscanon.com> - 2012-02-26 13:08 -0800
      Re: What is Model View Presenter. (Was: Hairy generics question) Arne Vajhøj <arne@vajhoej.dk> - 2012-02-26 18:17 -0500
        Re: What is Model View Presenter. (Was: Hairy generics question) sclaflin@webucator.com - 2012-02-28 06:22 -0800
  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