The Artima Developer Community
Sponsored Link

News & Ideas Forum (Closed for new topic posts)
Java Product Versioning

2 replies on 1 page. Most recent reply: Oct 1, 2002 5:49 AM by Erik Eide

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Java Product Versioning Posted: Sep 26, 2002 9:11 AM
Reply to this message Reply
Advertisement
"The six fields defined by the Java Product Versioning Specification allow the developer to define the title, version, and vendor of a component's specification and implementation. Separating specification and implementation allows the two to evolve independently. Many specifications are implemented by competing developers and vendors. Equally, many of these vendors make multiple releases implementing the same specification, such as bug fixes and performance enhancements in minor releases and upgrades," says Erik Eide in this JavaWorld article:

http://www.javaworld.com/javaworld/jw-09-2002/jw-0920-jpvs.html?


Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Java Product Versioning Posted: Sep 26, 2002 9:18 AM
Reply to this message Reply
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.

Erik Eide

Posts: 2
Nickname: eee
Registered: Oct, 2002

Re: Java Product Versioning Posted: Oct 1, 2002 5:49 AM
Reply to this message Reply
> 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.

Flat View: This topic has 2 replies on 1 page
Topic: I Like Your Type Previous Topic   Next Topic Topic: From Black Boxes to Enterprises: JMX

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use