Version history

R

Roedy Green

What is the canonical way to format version history, i.e. the version
numbers, release dates and changes. How do you embed this is the
comments?

Where does it go?
 
J

James McGill

What is the canonical way to format version history, i.e. the version
numbers, release dates and changes. How do you embed this is the
comments?

Where does it go?

Using CVS or SVN it's really easy.

/**
* @version $Revision$
* ID: $Id$
* Revision History:
* $Log$
* ... and so on with other tags ...
*/
 
T

Tail_Spin

This might be of help
http://java.sun.com/j2se/versioning_naming.html
http://java.sun.com/j2se/javadoc/writingdoccomments/

I'm sure you probably already know about this Roedy, but since we're talking
about javadocs, some poeple might find it handy.
http://java.sun.com/j2se/javadoc/index.jsp


(A bit off topic, but I find it useful)
One thing I do is include a System.out .... statement with the current
version info so that it will come up in a system window or java console.
That way I can check that actual version that is running. I found it handy
for applets.

public static final String CURRENT_VERSION = "2.0.1";
.... some more code ...

init() {
System.out.println("CURRENT_VERSION = " +CURRENT_VERSION);
....
 
R

Roedy Green

One thing I do is include a System.out .... statement with the current
version info so that it will come up in a system window or java console.
That way I can check that actual version that is running. I found it handy
for applets.

public static final String CURRENT_VERSION = "2.0.1";
... some more code ...

init() {
System.out.println("CURRENT_VERSION = " +CURRENT_VERSION);

How do you arrange that you can always invoke that method from the
command line?
 
O

Owen Jacobson

How do you arrange that you can always invoke that method from the
command line?

class Foo {
static final String VERSION = "1.0";
static {
System.out.println (Foo.class.getName () + " v" + VERSION +
", Loaded by " + Foo.class.getClassLoader ());
}
// ...
}

Just off the top of my head. I don't see the point, personally.

Owen
 
K

Kenneth P. Turvey

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What is the canonical way to format version history, i.e. the version
numbers, release dates and changes. How do you embed this is the
comments?

Where does it go?

This really depends on the version control software use. Typically
putting long change logs in each file is discouraged. This information
should be maintained by your version control software system e.g.
subversion.

- --
Kenneth P. Turvey <[email protected]>
Phone : (314) 255-2199

XMPP IM: (e-mail address removed)
Yahoo IM: kpturvey2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFECnuqi2ZgbrTULjoRAmG2AJwNYjcwFGU7kPW/71+Bz7GkDifFwQCeKLZG
i1tZZ+OfujK7NnuFNS+bIoY=
=mwoI
-----END PGP SIGNATURE-----
 
T

Tail_Spin

Actually I suppose you'd probably use an about box in an application.

And a certain key combination if it was a command line program.
Just off the top of my head. I don't see the point, personally.

I used it in an applet. The applet wasn't big enough to have an about box,
I was only allowed a height of 26 pixels. I had a bunch of slightly
different versions I was testing and would sometimes lose track of which
version I uploaded to the webserver, (especially if I got distracted by MSN
or something). So I just put a system.out... statement in the init()
function and then invoked the java console when I ran it. I later put a
tool tip in the applet that contained the version number. I couldn't be
sure that the highest version number in development was always the current
one on the webpage because I was trying different things and I didn't want
to accidently trash the currently working version that was uploaded, (
people get so upset !!! when all they see is a blank applet window, lol )

I know CVS is popular with PHP, C++, and anything UNIX / LINUX etc.
programming, but haven't seen too much about it with Java. I'm sure the
benefit would be worth the effort to find a version that would work with
java files -- Sun must use some form of CVS when creating Java.
What is the canonical way to format version history, i.e. the version
numbers, release dates and changes. How do you embed this is the
comments?

The java source code files that come with JDK are a great example of
internal code documentation.
 
O

Owen Jacobson

Drifting a bit...

I know CVS is popular with PHP, C++, and anything UNIX / LINUX etc.
programming, but haven't seen too much about it with Java. I'm sure the
benefit would be worth the effort to find a version that would work with
java files -- Sun must use some form of CVS when creating Java.

The term you're looking for is either "software/system configuration
management" (SCM) system or "version control system". For what it's
worth, CVS is starting to fade out a bit: subversion does everything CVS
does, better[0][1], so if you're planning on starting a new project and
don't have any existing version control system I'd highly recommend it.

-Owen

[0] though occasionally slower.
[1] Subversion has a non-confusing revision numbering system, atomic
commits (no partial commits, which can happen in CVS), proper support for
directories and metadata, and a far cleaner network access system.
 
T

Tail_Spin

Cool, I'll have to check it out.
Here's the link incase anyone else wants to check it out.
http://subversion.tigris.org/



message
Drifting a bit...

I know CVS is popular with PHP, C++, and anything UNIX / LINUX etc.
programming, but haven't seen too much about it with Java. I'm sure the
benefit would be worth the effort to find a version that would work with
java files -- Sun must use some form of CVS when creating Java.

The term you're looking for is either "software/system configuration
management" (SCM) system or "version control system". For what it's
worth, CVS is starting to fade out a bit: subversion does everything CVS
does, better[0][1], so if you're planning on starting a new project and
don't have any existing version control system I'd highly recommend it.

-Owen

[0] though occasionally slower.
[1] Subversion has a non-confusing revision numbering system, atomic
commits (no partial commits, which can happen in CVS), proper support for
directories and metadata, and a far cleaner network access system.
 
J

Jacob

Roedy said:
What is the canonical way to format version history, i.e. the version
numbers, release dates and changes. How do you embed this is the
comments?

Where does it go?

As already suggested, all version history should be maintained
by the VCS. Never put such information in the source code itself!
A decent VCS viewer will provide you with all necessary information
on request.

The "version numbering" (as in "4.0.1.31") is becomming obsolete
in todays more dynamic nature of software relase cycles. It is
replaced by build numbers and VCS tags. The development challenge
is to get hold of this information inside the program.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top