View Single Post
  #4 (permalink)  
Old 07-18-2007, 11:15 PM
JavaBean's Avatar
JavaBean JavaBean is offline
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
That is right. Then you will design your Object such a way that method can not change its content.

For example, define an interface which will only have the method you want to be called from this method and send this method the interface instead of actual object.

Of course the method can try casting the object to its actual type, but if you really want to protect that object then only way is to not sending that object obviously
Reply With Quote