Re: "protected" attributes in Component .java files.

From: Chuck Hill (chil..lobal-village.net)
Date: Tue Jul 03 2007 - 11:19:52 EDT

  • Next message: Lachlan Scott: "Noob: JDBC connection failed in Entity Modeler"

    I have never found a way to do this. It is one of the rare things in
    Eclipse that are not configurable.

    Chuck

    On Jul 3, 2007, at 3:47 AM, Tobias Crawley wrote:

    > Does Eclipse 3.3 support changing the default signature for getters/
    > setters? I much prefer the WO Way [ varname()/setVarname() ] vs.
    > the Java Way. I know it is not possible with 3.2, or else Mike
    > would have done it already.
    >
    > Tobias
    >
    > On Jul 3, 2007, at 3:21 AM, Ian Joyner wrote:
    >
    >> Anyway, a project with private and protected fields and lots of
    >> errors in the .wod files will still run OK. If you consider that
    >> the .wod spec is tightly bound to the class, you are not really
    >> breaking encapsulation, because you might still want to hide those
    >> fields from other classes. Thus fix from Mike will be appreciated
    >> – I don't like ignoring errors because there might be a real one
    >> in there. (So much for '()' breaking encapsulation and exposing
    >> implementation!)
    >>
    >> Ian
    >>
    >> On 03/07/2007, at 10:47 AM, Ian Joyner wrote:
    >>
    >>> On 03/07/2007, at 10:19 AM, David Avendasora wrote:
    >>>
    >>>> Well, if you fix it, please do it _after_ you write the new
    >>>> WOBuilder. ;)
    >>>
    >>> Nah, let him fix it now ;-) Just think if C-based languages
    >>> didn't have that wacky '()' function call syntax, you wouldn't
    >>> need getters at all!
    >>>
    >>> Ian
    >>>
    >>>>
    >>>> On Jul 2, 2007, at 5:53 PM, Mike Schrag wrote:
    >>>>
    >>>>> It's a wolips bug for a particular case that eclipse people
    >>>>> don't tend to run into, but wobuilder people do because wob
    >>>>> generated kind of crappy java. I was not planning on fixing it,
    >>>>> but I think I may just because it's only going to become more
    >>>>> common as more people make the jump.
    >>>>>
    >>>>> On Jul 2, 2007, at 6:22 PM, David Avendasora
    >>>>> <webobject..vendasora.com> wrote:
    >>>>>
    >>>>>> Oh, believe me, I don't want to change them to public, I'm
    >>>>>> just trying to figure out why Eclipse (WOLips?) is complaining
    >>>>>> about them being protected, when WOBuilder never did. I didn't
    >>>>>> know if there was some configuration within Eclipse/WoLips
    >>>>>> that would tell it that it was okay and not an error, or if I
    >>>>>> had somehow set it up incorrectly.
    >>>>>>
    >>>>>> But it sounds like what is being said is that to make it (the
    >>>>>> error flag) go away, you have to add public getters and
    >>>>>> setters, right? I know it's easy in Eclipse, just wondering if
    >>>>>> that's the right route.
    >>>>>>
    >>>>>> Dave
    >>>>>>
    >>>>>> On Jul 2, 2007, at 4:44 PM, Janine Sisk wrote:
    >>>>>>
    >>>>>>> On Jul 2, 2007, at 2:35 PM, David Avendasora wrote:
    >>>>>>>
    >>>>>>>> The problem I'm running into is that almost all the
    >>>>>>>> attributes that
    >>>>>>>> were setup in WOBuilder are "protected", and now Eclipse is
    >>>>>>>> reporting
    >>>>>>>> that the attributes don't exist. If I mark them as "public"
    >>>>>>>> then the
    >>>>>>>> problem goes away.
    >>>>>>>>
    >>>>>>>> What is the proper way to handle this?
    >>>>>>>
    >>>>>>> I'm feeling an urge to channel Chuck....
    >>>>>>>
    >>>>>>> He has taught me, forcefully :), that the right thing to do
    >>>>>>> is to leave these protected and write getter and setter
    >>>>>>> methods for them. Yes, it's kind of a pain. But he says
    >>>>>>> that this protects you in the future; if you end up actually
    >>>>>>> needing to use an accessor method then you can just modify
    >>>>>>> the one that's already there instead of trying to track down
    >>>>>>> all the places you accessed the variable directly. It's also
    >>>>>>> better if you need to subclass in the future, I imagine for
    >>>>>>> the same reason.
    >>>>>>>
    >>>>>>> It's not quite as much work as it sounds; if your variable
    >>>>>>> is named foo, and your getter and setter are foo() and setFoo
    >>>>>>> () respectively, WO will find and use them automatically. So
    >>>>>>> you don't have to change your bindings.
    >>>>>>>
    >>>>>>> janine
    >>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>
    >>>
    >>
    >>
    >>
    >
    > ---
    > Tobias Crawley
    > tobia..luecollarsoftware.com
    >
    >
    >

    -- 
    

    Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects



    This archive was generated by hypermail 2.0.0 : Tue Jul 03 2007 - 11:20:59 EDT