Go to
Prem Kurian Philip's Home Page
Java as the primary class library for Linux
Introduction
I have been thinking about the benefit of having a system-wide class library on Linux in the lines of the .NET framework on Windows. This library could have a nice namespace hierarchy allowing for common functions to be grouped together in related classes. This class library could also include additional classes for configuration management - say, for instance, when you want to get the address to the SMTP server, you could just use something like this:
Configuration config = ConfigurationManager.
getConfiguration();
String smtpServerIP = config.
getSetting("SMTP_SERVER_IP");
This class library must cover all aspects of application programming including:
- Comprehensive set of data structures and algorithms
- Directory services management with additional support such as JNDI
- Management Services API
- Support for classes and objects with various security levels and lifetimes locatable and callable using a directory service
- Security and Encryption (including PKI, certificates etc)
- Processes, Threading and synchronization management
- Interprocess Communication
- Authentication and Access Control Management
- Services Management
- Configuration Management
- Advanced Database Management Support (connection pooling, transactions, driver management, ORMS)
- GUI management
- Networking
- Resource Management
- File System Management
- Compression
- Multimedia
- XML parsing support
- Support for remote procedure calls
- Webservice support (Server and client)
- Memory management + automatic garbage collection
- Support for developing web applications
- Support for client-side applications over the web
- Support for calling C API and to be called from C
- Dynamic loading of modules
- Deployment support + Package/library management
- Distributed application support
- Reporting
(NOTE: I may have missed a few here)
Java already includes pretty much everything in the list above and may be the most appropriate option for a class library on Linux. Some of the reasons I think so:
1. Comprehensive API covering pretty much everything in the list above.
2. Cross-platform support
3. Nice ability for managing the installation of classes (and not just full blown applications)
4. Technology such as JNDI for directory services management.
5. Support for life-cycle management of classes as well as applications
6. Sophisticated deployment tools and architecture.
7. Sophisticated management of dependencies in packages (eg: Maven)
8. Sophisticated tools for interoperability with non-java software (JNI)
9. Excellent support for networking
10. Excellent management tools
11. Same API can be used within web applications as well as desktop applications
12. Widespread availability of first-class libraries and tools (free and commercial)
13. Maturity
14. Ease of installation
15. Widely supported by enterprises
16. Well documented
17. Frequently updated. A lot of research goes into the development of the Java SDK
18. Excellent developer support
19. Projects such as
Terracotta∞ which allows for clustering of JVMs.
Information on some of the other alternatives to Java and why I don't think they are as desirable as Java is given
here
Concerns with Java
1. Performance - One of the concerns about Java is performance. A Java application can take a while to startup, and this has primarily to do with the time it takes for the JVM to start up. If the JVM is started when the Linux PC boots up, then perhaps this delay won't occur when individual Java applications are started up.
2. Stability - What are the implications when a single JVM runs multiple java applications?
Overall Architecture
I have listed a possible bootup sequence on a computer running Linux and utilizing this Java System API.
1: The Linux PC will be started up with very few services running.
2: The Java Virtual Machine will be started up. Perhaps Terracotta can be used for clustering the VM.
3: The Apache Directory Server starts up
4: The J2EE application server starts up. This provides the JNDI infrastructure
5: The Configuration EJB entity starts up
6: The Configuration Management Webservice is started which can be used to read/write configuration entries using the EJB
7: The Configuration Information is saved in the database or written to an XML file.
- Versioning support is included
- Transaction support is included
8: The environment is now fully setup and ready to service requests from any application.
9: Additional services can now start up. These services can install their own beans into the J2EE framework
10: Applications connect to the Configuration class using JNI and are able to retrieve/save their configuration settings
1 Java API
2 J2EE Server
3 Configuration Management Service and classes
4 Configuration Store
5 Applications
Page was generated in 16.9275 seconds