Chapter 12. Multifile Versioning

So far, we've only considered versioning scenarios in which the versioned file is independent from all other versioned files. Versioning gets much more complicated when multiple files with relationships to each other may be checked out and checked in.

Let's imagine a simple Java program for finding employee information, department information, and which employees are in which department. The program requires only two source files, Employee.java and Department.java, and each file corresponds to a Java class. The Java object for a Department references a number of Employee objects when the code runs. Thus, Department.java must reference the other file when it is compiled. If Department calls a method getID() on Employee, then the method getID() must exist in Employee.java for the code to compile (see Figure 12-1).

Figure 12-1. Multiple-file version tree example.

graphics/12fig01.gif

When Department.java and Employee.java are first created as files, they compile successfully into executable code. Thus, version 1 of Department.java and version 1 of Employee.java are related. Then some changes are made to Department.java, creating version 2, which still compiles with version 1 of Employee.java.

When a developer decides to work on a feature (adding the ability to find the manager of an employee or department) separately from the main effort, the developer forks each version-tree. On the new branch, v5 of Department.java compiles with v4 of Employee.java. However, development continues on the main branch: v4 of Department.java compiles with v5 of Employee.java. The versions on the different branches don't compile with each other, so the latest version of Employee.java (v5) doesn't compile with the latest version of Department.java (v5).

How can the developers of this project keep track of which branch they're working on across a number of files? How can they check out versions that compile together? How can they look back in time and identify sets of versions that compile together? These are the kinds of problems solved by multiple-resource versioning features.

In this section, we'll examine those features. However, in the interest of not putting you to sleep, this chapter doesn't describe features in detail. Still, the chapter is pretty dense and complicated. Many applications don't involve dependencies between resources and thus don't require these features, so probably many readers can skip this chapter.



WebDAV. Next Generation Collaborative Web Authoring
WebDAV. Next Generation Collaborative Web Authoring
ISBN: 130652083
EAN: N/A
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net