Cjos Pages; [ Cjos Audience]
About this document
This document provides a summary of the CjOS Project @ cjos.sourceforge.net.
This document contains the following sections:
- Section A - Our Project
- Section B - Our Results
Section A - Our Project
This section highlights some of the features of our project.
Maintaining an object-oriented class library in any programming language presents certain un-avoidable challenges. Maintaining a Java class library is no exception. Typically, dependencies among class libraries are more complex than dependencies of equivalent function libraries.
We ask, " Is perfect backward compatibility possible? " Our research shows that perfect backward compatibility is both possible and beneficial. Certain design patterns emerge. Specific programming techniques are recommended.
Our project provides use-able, re-usable, production-quality components. Further, it demonstrates how we have put these design patterns and programming techniques into practice.
Our project is open source software so that you can review what we have written and, hopefully, learn from it.
Our project is free license software so that you can include our production-quality components in your software.
Relationship with sourceforge.net
We are grateful to sourceforge.net for their continued support of open source and free license software.
sourceforge.net enables us to concentrate more on the development of high quality Java software and less on infrastructure, such as a website, CVS repository and file release system.
Relationship with JOS Project
We thank members of the JOS Project for their contribution to our success. The JOS Project @ sourceforge.net enables us to concentrate more on building the Java software and less on providing a development infrastructure. We share the JOS Wiki with other sister projects. We share the jos-general mailing list.
Section B - Our Results
The Java community has not yet embraced the need for stability. Stability is the presumption that an API is backward compatible, unchanged, unchange-able. It is a prerequisite for building an operating system.
The C programming language embraces a separation of concerns. The API for an application as large as a kernel is distributed as header files. The most senior programmers are given the responsibility of maintaining header files in a backward compatible way. The header files are a most important asset; it defines the interface to a kernel.
Like C, the C++ programming language embraces a separation of concerns. The API is distributed as header files.
- Generalization: The header files in C++ are more difficult to maintain in a backward compatible way.
Compared with C++
Like C++, Java technology from Sun Microsystems strongly support object-oriented programming.
Unlike C and C++, Java technology does not embrace a separation of concerns. Both an API and implementation are compiled into class files.
- Both are often distributed in the same jar.
Like C++, Java technology supports a standard class library.
Unlike C++, the standard Java class library does not embrace a separation of concerns. Both API and implementation are distributed in the same jar.
Unlike C++, the standard Java class library does not embrace backward compatibility and stability required by an operating system.
An operating system is a critical, vital piece of software. Likely, the kernel is the most important piece of software running on a machine.
Without a preprocessor and many versions of Java, it is difficult to build a Java-based operating system. The following versions of the standard Java class library exist:
- JAVA 0 (JDK 1.07)
- JAVA 1 (JDK 1.1.7b)
- JAVA 2 (JDK 1.2.2)
- JAVA 3 (JDK 1.3.0)
- JAVA 4 (JDK 1.4.2_10)
- JAVA 5 (JDK 5.0)
- JAVA 6 (JDK 6.0)
But, it is not impossible.
In order to increase stability to the level required by an operating system, use explicit versioning.
Explicit versioning requires each version of an API to be written into a separate package. There is more than one proposal for package naming.
Let's take Smart Api as an example.
- Version 1a - org.jos.smartapi1a
- Version 1b - org.jos.smartapi1b
- Version 2a - org.jos.smartapi2a
- Version 3a - org.jos.smartapi3a
- Version 4a - org.jos.smartapi4a
- Version 5a - org.jos.smartapi5a
Version 1a of the Smart API is still available today, exactly as it was published. Any program that depends upon version 1a continue to run--without modification.
A universal factory enables a program to run--without modification--on a number of different versions of Java, on a number of different test systems.
Some examples of a universal factory include:
- Bytecode Native Interface (BCNI)
- Smart Api
How do we maintain a very large class library?
The strongest bonds are bonds of cohesion and dependency. Therefore, a very large class library should be divided along lines of cohesion and dependency. To reduce the number of dependencies, it is important to develop well-known interfaces and base classes. A well-known interface survives the test of time. It remains the same for a life-time.
- Premise: A very large class library must be built from its source code.
- Consequence: It is not pragmatic to distribute a very large class library as one giant archive.
- Consequence: It is not pragmatic to build a very large class library as one giant archive.
- Consequence: It is not pragmatic to allow each class depend upon all other classes.
- Premise: Building from source code must be repeat-able.
- Consequence: An artifact must be re-built when its dependent artifacts have been re-built.
- Consequence: An artifact must be re-tested when it is re-built.
- Consequence: It is not pragmatic to build all artifacts when only one artifact has changed.
- Premise: Artifacts must be distributed.
- Consequence: The maintenance process itself is distributed.
- Consequence: Artifacts must be installed on a production machine.
- Premise: Artifacts must be customize-able for multiple versions of Java.
- Premise: Artifacts must be customize-able for multiple operating systems, such as
- OS/400, and
- Microsoft Windows.
- Premise: Artifacts must be customize-able for multiple containers, such as
- Apache Ant,
- Java application,
- Java applet,
- Java servlet,
- EJB, and
- Web service.
By experimenting with a number of different strategies, we have identified strategies that work and strategies that do not work. What strategy are you using?
- A uniform resource identifier (URI) provides access to a mechanism.
- A mechanism is implemented behind a well-known interface and corresponding factory.
- A plug-in is developed to connect the URI mechanism with the corresponding factory.
- An implementation is maintained with XML Varient Configuration Language (XVCL). XVCL enables a very large class library to remain flexible and nimble.
- Repackaging after the fact. Assigning a part to a model is external to the part.
- Experimental code co-exists with production code.
- Dividing a very large class library into relevant, independent modules requires much skill.
- A class can be developed in multiple modules.
- Namespace must be managed across multiple modules.
- Any division of a very large class library adds complexity to the production environment because multiple inter-related artifacts must be installed, not just one.
- Any division of a very large class library adds complexity to the development environment because it is possible to develop a class in multiple modules.
- Adding XVCL to Java development environment demands additional skills.
- Apache Ant
- Installing XVCL Plug-in for Eclipse 3.1.
Theory vs. Practice
Software development is a practice. How do we experiment with different strategies? We select a strategy and use it to develop a very large class library. By practicing a strategy we learn about the consequences, predicted and unpredicted.
- Apache Ant. Rebuild a module from its original source code. The build process is distribute-able; it can be distributed to other developers.
- BulkMake. Develop and use incomplete implementations of a package.
- WebSource. Review the source code, even incomplete implementations.
- JavaDoc. Comprehend a module of a very large class library.
- CVS. Support platform-independent modules compatible with multiple operating systems, such as Linux and Microsoft Windows.
- XVCL. Generate the Java source code, package.html, properties files, Ant scripts, and other resources.
- Smart API. Select platform-dependent modules at runtime. Select implementation at runtime.