When developing an application—be it a Web, enterprise, or scientific one—developers often rely on different frameworks to provide a base for the application to be built upon. These frameworks consist of a complete set of components, functions, and services, specific to a particular kind of application development.
There are various frameworks, free Open Source as well as commercial ones, being widely (and commercially) used at present. Some of these frameworks are listed below:
- Web/GUI development: Struts, Cocoon, Velocity, Tapestry
- Business logic development: EJB
- Persistence: JDBC, JDO, Hibernate
- Security/Authentication: JAAS
- Messaging: JMS
Each of these frameworks provides all things necessary to create an application or an application component of a respective type. Thus, they are very useful in application development if used independently. But, the problem arises when these different frameworks are required to be integrated and work together to build a complete application. There are two common problems:
- Many frameworks are bundled, or tightly coupled in other words, with containers, servers or other frameworks; creating a “work best in recommended combination” situation. Such tight couplings limit developers’ choice of frameworks and prove a hindrance for those who want to implement other frameworks in place of preferred combinations due to cost, security, ease-of-use, or performance-related concerns.
- The lack of a common interface with which these frameworks can communicate with each other. This makes application integration difficult and developers have to write code to make communication/integration possible. This code is often non-standard and may need constant upgrading down the road.
The Keel framework helps overcome both of these problems.
Keel is an efficient and highly extensible Open Source meta-framework, i.e. framework of frameworks, written in Java and currently in version 2.0 RC 1. Based on the popular Apache Avalon project, the Keel framework integrates together different types of (Java-based/Open Source or Commercial) frameworks, each specializing in a particular aspect of application development, such as user interface, database, messaging, security, and so forth. Keel brings together these frameworks to create a complete and well-integrated application from the solutions they provide.
Keel allows developers to “plug or unplug” desired frameworks anytime to/from the application these frameworks are integrated into. This way, Keel gives developers the freedom to choose frameworks from a wide array of frameworks available, which are best suited for specific application development needs, while avoiding the tight coupling of frameworks.
Keel also provides a a common means of communication among different frameworks, which remains unchanged when frameworks are plugged or unplugged. Keel achieves this by treating all application components, where each one may be based on a different framework, as independent units. Each independent unit is accessible through a standard interface, which serves as an invoking point of the services provided by the unit. The remaining units interact with this interface only, oblivious to what unit based on which framework is behind the interface. When a framework is replaced, only the respective unit’s interface requires a small amount of change; the rest of the application remains unchanged.
Core Concepts of Keel
Keel is build around three core concepts . They are as follows:
- Each application is made of independent units, or “components,” that are accessible through standard interfaces. This concept, known as Component Oriented Programming (COP), provides the flexibility of plugging/unplugging frameworks into the application.
- Each aspect of a component is separated (/broken) into as many independent tasks (or “concerns”) as possible, while each task is represented/handled separately by a standard interface. This approach, known as Separation of Concerns (SOC), allows the user to perform/control/modify any function of the component without affecting others.
- Each component is externally manageable throughout its lifecycle, with the help of configuration files. This approach, known as Inversion of Control (IOC), makes controlling a component’s behavior from the outside possible, easy, and efficient.
The following section shows these concepts at work.
Conforming to the COP concept, Keel specifies a generic set of services that can serve as building blocks for an application being integrated. Some major services are listed below:
- Model: Service for interacting with application or business logic.
- Persistence: Service for managing storing and retrieving object states and data.
- Security: Service for managing security of application, including authentication and authorization.
- Scheduling: Service for scheduling the execution of the application’s various functionalities.
- Crypto: Service for encryption of transmitted application data.
These services, known as roles, are provided by the various components integrated by Keel into the application. Each role is actually an interface to a corresponding component that defines the service contract.
The components are the implementations of roles and perform all tasks necessary to “carry out” corresponding roles. Keel provides default implementations for most of the services, while allowing developers to create their own components based on desired frameworks to put behind the interfaces.
Figure 1. Example of Keel Roles and Components
True to the SOC concept, each aspect of a component is segregated into independent tasks handled by separate interfaces. For example: a component can be logged, secured, persistent, and configurable. Each of these concerns is handled by separate interfaces.
Following the IOC concept, all the roles and components are externally manageable. Keel consists of the configuration files roles.xconf and system.xconf for configuration of roles and components, respectively. These files can be modified at any time to change the configuration.
Keel currently provides default implementations for most of the roles it defines, along with other implementation choices. Developers can use these default implementations, modify them to suit their requirements, or develop their own implementations and plug them into Keel. Given below is the list of some major roles, the frameworks their default implementations are based on, and other possible options:
- Model: One default implementation is org.keel.service.model.StandardModel, an abstract class implementing the Model interface, which accepts requests generated by the user interface (UI), processes the request, and sends the resulting response back to the UI.
- Persistence: The default implementation is JDBC datasource. Other options are JDO, Hibernate, Entity Beans of EJB, and LDAP.
- Scheduling: The default implementation is Quartz. Other options include JCrontab.
Work is in progress to add more implementations for all the roles, to provide developers with a wider choice of frameworks to base their implementations on.
Keel is a powerful integration framework that brings together different types of application frameworks, yet avoids tight-coupling any of them together. Keel allows a user to plug and unplug desired frameworks into an application at any point in time, thus giving developers freedom to pick and use the best frameworks available to fulfill changing application development needs.
About the Author
Mugdha Chauhan (formerly Mugdha Vairagade) is a senior IT consultant and author. An Open Source supporter, she frequently writes articles and tutorials on useful emerging Open Source projects. Major tech portals including developer.com, IBM developerWorks, CNET Networks, Slashdot, and many eZines regularly publish her work. Her expertise and interests include Java, Linux, XML, wireless application development, and Open Source.