Hi Ulf:

One way to solve this would be to introduce a static field named e.g.
"version" which would carry the exact version information.

This sounds like a good idea. Just don't make the field final, or clients
compiled against one version will not be able to distinguish it from
another version. Some libraries do that, and the only way around it is to
use reflection on the field.
Here are the code snippets from my present version of "BSFManager.java":

   // version string in the form of: "abb.yyyymmdd",
   // where "a" is the major version number, "bb" the minor version number,
   // and "yyyymmdd" represents the date in sorted order (four digit year, two 
digit month, two digit day)
   protected static String version="204.20060117";


  /** Returns the version string of BSF.
    *
    * @return version string in the form ""abb.yyyymmdd"" where
        *      "a" represents the major version number,
        *      "bb" the minor version number,
        *      "yyyy" four digit year,
        *      "mm" two digit month, and
        *      "dd" two digit day.
    * @since 2006-01-17
    */
   public static String getVersion()
   {
       return version;
   }

So access to the version string should be via its get-method "getVersion()".

Any thoughts, ideas, further comments?

Regards,

---rony







Reply via email to