Re: WOComponents, Packages, and Protected variables.

From: Chuck Hill (chil..lobal-village.net)
Date: Thu Aug 16 2007 - 13:10:34 EDT

  • Next message: Guido Neitzer: "Re: WOComponents, Packages, and Protected variables."

    On Aug 16, 2007, at 8:56 AM, Anders Peterson wrote:

    > Mike Schrag wrote:
    >> This "bug" is actually fixed in newer builds ... Maybe only in the
    >> 3.3 one, not sure, but it's REALLY for the best to fix this
    >> properly in your code.
    >> ms
    >
    > 3.3... Is this an eclipse bug?
    >
    > From the other answers it seems I misunderstood the original
    > question. I thought David was looking for the
    > KeyValueCodingProtectedAccessor class.
    >
    > I have one of these in every package containing components.

    This is a good way of implementing David's idea:

    > I would think that the Component for a given Java Class would be
    > considered as being in the same package.

    That makes sense to me from an architectural point of view, but won't
    "just work" due to how Java works. The
    KeyValueCodingProtectedAccessor "teaches" Java about this extension
    to its access rules.

    That said, I usually use Public for ivars that are _only_ accessed in
    bindings on a page or component that will not be sub-classed (e.g.
    the item in a WORepetition that is only ever referenced in a
    WOString). For all other uses (things that will get subclassed,
    ivars that are referenced in code) I create accessor / mutator methods.

    Chuck

    -- 
    

    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 : Thu Aug 16 2007 - 13:11:33 EDT