[jboss-dev-forums] [Design of JBossCache] - Protected fields in TreeCache

bstansberry@jboss.com do-not-reply at jboss.com
Wed Jul 19 11:28:22 EDT 2006


As part of the API cleanup for 2.0, what do people think about changing all the protected fields in TreeCache to private, or, if needed, package-protected?  A protected field is really part of a class' public API.  Since we're going to the effort of locking down all the API's, this seems like a good thing to lock down as well.

If any of these fields really need to be exposed to subclasses, we can do it through a protected setter/getter, which IMHO is a more controlled way of exposing something as part of the public API.

I realize we're doing things like using Cache and CacheSPI to isolate the "user API" from the internal one, but I think its also a good practice to limit the public API of the internal classes as much as possible.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959179#3959179

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959179



More information about the jboss-dev-forums mailing list