I agree with Igor here. If you are really concerned about protecting private
fields, your only option is running with a security manager. Otherwise there
will always be a way around it. Being able to access private field is
convenient and reduces code clutter. Even though it's not the "cleanest" way
around, the practical benefits IMHO outweight the drawbacks.

-Matej

On 8/26/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> On 8/25/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> >
> > So you write a class with a certain member, but as you don't want
> > people to directly access that member, you don't provide an mutator
> > method. Someone else takes a look at your class and decides to
> > directly access the member using property model regardles. I know
> > people can do it with introspection anyway, but it arguably breaches
> > encapsulation.
>
>
> my point is only that if people wanted to do this they could with or
> without
> the propertymodel. and if you realllllly dont like it just go ahead and
> install a security manater.
>
>
> If you have a component/ page with members and in that
> > component/ page you link a property model to it, I think it is fair to
> > say you'd like to access the property as an implementation detail. But
> > for regular domain objects, I don't see why normal rules of
> > encapsulation wouldn't apply.
>
>
> what if i have a non-public top level class in my ui package sitting next
> to
> the component that uses it as a propertymodel object? all im saying is
> that
> narrowing it down to a direct property of a component is too narrow. in
> fact
> it just makes it more confusing when it does and does not work.
>
> Anyway, we built the damn thing so we know about it, though I - as a
> > member of the dev team - didn't even know about this 'feature' until
> > recently, neither did Martijn give this any special mention in his
> > chapter on models so far. Also, this is the second time the topic
> > comes up, so I don't think it is as obvious or intuitive as you are
> > suggesting.
>
>
> yes it is the second time this topic comes up out of how many of thousands
> of users there are....
>
> i dont know. i think this feature is very convenient. it is not something
> you can toggle on and off because 3rd party components might be written
> with
> this in mind. so i would say keep it, end of story. but that is just me.
>
> -igor
>
>
> Eelco
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

Reply via email to