The Artima Developer Community
Sponsored Link

Class variables

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Class variables

Posted by Celia Jia on 24 Feb 1999, 7:38 AM

As you recommonded, to enforce data-hiding, we should declare class variables as final. But what if we want to give end-user to modify the value of these variables through a plain text file? For example, we declare some file path as static string variable in a class, and then allow user to change the path in a plain text. So everything the class is loaded, it will read from the plain text file first. If the path is not defined there, it will use the default value in the class. But the client of that class won't know anything about this overriding. Do you think it violates the data-hiding thesis?



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us