ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict" <pbened...@apache.org>
Subject Re: How to support read-only fields/paramters
Date Tue, 08 May 2007 00:04:48 GMT
Gordon,

The notion of public, protected, and private are design constructs, not
runtime behaviors. The JVM may have permission to anything it wants, unless
security is installed. I once fell into this trap too :-) It's not pretty.
Just understand that you're read-only interfaces are to help design well,
not to prevent the magic of reflection. Think design, not physical laws of
the universe.

Paul

On 5/7/07, Niels Beekman <n.beekman@wis.nl> wrote:
>
> Java Reflection allows to bypass this using
> Member.setAccessible(true)...
>
> Niels
>
> -----Original Message-----
> From: Gordon Ross [mailto:G.Ross@ccw.gov.uk]
> Sent: maandag 7 mei 2007 11:10
> To: user-java@ibatis.apache.org
> Subject: RE: How to support read-only fields/paramters
>
> Yes it does help : It works  a treat - but how ?  Private methods are
> only accessable from within the class itself, and iBatis is not part of
> my class.
>
> GTG
>
> >>> "MCCORMICK, Paul" <Paul.McCORMICK@doir.wa.gov.au> 05/07/07 8:35 AM
> >>>
>
> Ibatis can use the private methods.
>
> E.g.  If you define the method as "private void setId(Integer id) {..}"
> then ibatis can call it.
>
> Hope this helps,
>
>

Mime
View raw message