Erik Eide
Posts: 2
Nickname: eee
Registered: Oct, 2002
|
|
Re: Java Product Versioning
|
Posted: Oct 1, 2002 5:49 AM
|
|
> The article mentions: > > The java.lang.Package class provides a method > called isCompatibleWith(String version), > allowing the specification version of a component to > be checked programmatically. Why is that useful? It > allows a system's dependent parts to verify that a > new or upgraded component conforms to the > specification or contract that it expects it to. > > This surprised me, so I looked up the JavaDoc. I > believe I misinterpreted the author when he said > "verify that a component conforms to the spec" to > mean a component can decide to conform to its spec or > not, which is not the point of that method. The > method just compares version numbers of the package > it represents and a passed version number that is > needed by the caller. If the version number of the > package is greater than or equal to the passed > version number, isCompatible returns true. So > the inherent assumption is that every subsequent > version of every package is binary (including > semantics) compatible with previous versions.
Hi Bill
There was a typo on my behalf that slipped through. The intended text was "It allows a system's dependent parts to verify that a new or upgraded component conforms to the specification or contract that they expect it to."
Essentially, all I was trying to say was that we can programmatically check what version of a specification a component claims to implement. Perhaps I should of stated explicitly that this is not a check of binary compatibility of a package, such as defined in the JLS.
Unlike the specification-version attribute which is constrained to a decimal numeric type, the implementation-version attribute can contain any free-form text you wish - making it difficult to do a similar comparison.
Maybe Sun should of considered naming their method isCompatibleWithSpecification(String ver) to avoid the ambiguity of which version is being compared.
|
|