Immutable pojos as context objects

2005-02-11 Thread Serge Knystautas
I was wondering if there is a convenient way to restrict method calls on objects I put into VelocityContext. I use Velocity templates to do dynamic renders high-traffic websites, and I instantiate VelocityEngine objects along with various POJOs that Spring assembles. These POJOs are sort of

Re: Immutable pojos as context objects

2005-02-11 Thread Mike Kienenberger
Serge Knystautas [EMAIL PROTECTED] wrote: I was wondering if there is a convenient way to restrict method calls on objects I put into VelocityContext. I use Velocity templates to do dynamic renders high-traffic websites, and I instantiate VelocityEngine objects along with various POJOs

Re: Immutable pojos as context objects

2005-02-11 Thread Serge Knystautas
Mike Kienenberger wrote: Well, the easy answer to this part of the question is to implement a custom Uberspect. http://jakarta.apache.org/velocity/api/org/apache/velocity/util/introspection/Uberspect.html There's examples of this on the wiki:

Re: Immutable pojos as context objects

2005-02-11 Thread Mike Kienenberger
Serge Knystautas [EMAIL PROTECTED] wrote: Mike Kienenberger wrote: Well, the easy answer to this part of the question is to implement a custom Uberspect. http://jakarta.apache.org/velocity/api/org/apache/velocity/util/introspection/Uberspect.html There's examples of this on the

Re: Immutable pojos as context objects

2005-02-11 Thread Barbara Baughman
Velocity itself has a rule to accept all public methods. It is up to the programmer to decide which methods to make available to Velocity by making the methods public. Velocity, even JAVA, has no way of knowing if a method will change the underlying class. Making a class immutable is up to the