What is CUBA?

CUBA is a very small and easy to use development toolkit for the design of component-based Java applications which can be run as EJB 2.1 and EJB 3.0 applications, AXIS web services or stand-alone J2SE programs. CUBA provides an EJB-3-oriented component model and a descriptor and code generator to produce adapters for multiple runtime environments.
CUBA Runtime Environments 
When running components in a managed environment, CUBA just acts as an ultra-thin compatibility layer, suitable for every JEE-compliant application server. For non-managed environments, CUBA's own mini container provides a fully functional local living space for the same components, without having to modify any code. The framework was originally intended to meet two major interests:

Real reuse of components
    Components developed for one application should be reusable in others without modification, even if the applications are based on different runtime environments. CUBA components can be run in both managed and unmanaged environments and therefore allow to choose well-suited software platforms for each project. Many applications nowadays suffer from strategic decisions for Enterprise JavaBeans which are reasonable for large and scalable high-end server systems on one hand but not e.g. for simple, sequential overnight batch processing or rich clients. CUBA allows to use the same components in all these different applications.

Efficient development of server-components
    Developing JEE or other server-based applications is often unconvenient and inefficient, causing everyone concerned to struggle with application servers, remote debuggers, and annoying deployment periods. CUBA allows to develop and test EJBs and AXIS webservices without using an application server resp. servlet engine at all. Fast and simple edit-compile-test cycles apply as they are known from ordinary J2SE development. Running CUBA in J2SE mode allows to make use of some helpful testing features like accessing internal components from JUnit test clients or exchanging component implementations by mock variants at runtime.

How to learn CUBA? 

For a quick introduction you shuld have a look at the HelloWorld example in the introduction of the CUBA manual. The distribution also includes various additional examples for all important aspects of the framework.

CUBA and EJB 3.0

Developing a CUBA components is similar to writing an EJB 3 component using either code annotations or XML descriptors for the specification of meta information. However, CUBA is not exactly EJB 3 but wraps the standard almost completely and provides an equivalent to all relevant API and description artefacts. This was an essential design desicion for making CUBA components independent from any assumptions about a particular target runtime environment. CUBA components can e.g. be run on both EJB 2.1 and EJB 3.0 containers without modification. Platform-dependent aspects are completely hidden in generated adapter classes acting as a compatibility layer and emulation wrapper (e.g. performing the dependency injection in EJB 2.1 environments). The support for both versions of containers provides a very interesting migration option for developers who can not move to newer application servers in the near future.

CUBA also brings the vision of EJB testing without application server alive. Since EJB 3, the standard is designed for this requirement e.g. by means of its POJO approach and the new dependency injection which in general allows to instanciate components like an ordinary class for test purposes. However, in many cases it will turn out that even simple test scenarios require a minimum of container services, e.g. concerning transaction management and user authentication. CUBA provides such a mini container and is therefore the perfect basis for rapid component development. This was already the case for CUBA 1, of course, and it is not related to EJB 3 from a CUBA developer's point of view.

As CUBA already applied some fundamental simplifications of EJB 3 in its earlier versions (e.g. no home interfaces were needed), the component and programming model is upwards compatible with CUBA 1 and 2. Most components developed on older CUBA releases should therefore work in CUBA 3 right from the start simply by re-generating adapters and descriptors.

CUBA and persistence

CUBA supports the Java Persistence API and integrates with various independent persistence management toolkits which can be set on top of the framework's general resource and transaction management. Examples for using the open-source ORM toolkits Apache OJB, PriDE, and Hibernate are included in the CUBA delivery.