📜 ⬆️ ⬇️

CUBA Platform: Java RAD open source framework

image Almost three years have passed imperceptibly since the publication of the first article about the platform on Habré. During this time, much has changed: we entered the international market, switched to open source licenses , updated the technology stack and made many improvements to the framework and development tools. Therefore, instead of a long list of changes, we decided to publish another review article about the CUBA platform, which, I hope, will be of interest to the developers of the bloody enterprise information systems enterprise - both unfamiliar with the platform and those who have already heard about it.

So, under the cut, you will learn:

What tasks solves the platform?


First of all, the CUBA platform is aimed at developing corporate information systems. Typical characteristics of such applications: a developed data model, dozens and even hundreds of relatively standard screens, support for a large number of complex business processes, a lot of reports, requirements for the differentiation of access rights, and so on.

Key features of the platform:
')

In aggregate, this allows minimizing the time spent on “system” tasks - setting up the project infrastructure, integrating technologies and components, developing basic functionality - and concentrating on the implementation of business requirements. At the same time, CUBA does not restrict access to low-level code, ensuring the ability to adapt it to the needs of the project.

How does it work?


CUBA-based applications have a standard three-layer architecture. The connecting element of the system is metadata - information about the data model of the application. Thanks to metadata, visual components know what data they are working with. For example, the table knows that it displays the attributes of the “driver” entity and automatically fills in the names and format of the columns. In the same way, metadata helps visual components to work with the database through the ORM, specifying the graphs of the objects that need to be loaded or updated. The same principle applies to the security subsystem, report generation and other parts of the platform.

The platform is distinguished by a rich declarative web interface: you can create screens in a visual editor or in XML, choosing from dozens of visual components from various buttons to Google Maps and dynamic graphs. The logic of initialization and event handling is then set in Java (or Groovy) controllers. Given the binding of components to the data, you can very quickly create a complex UI, which at the same time will be easy to maintain due to the clear separation of code from markup. If the choice of available components is not enough, the platform has a mechanism for integrating external components written in Vaadin, GWT or JavaScript.

image
Screen of one of the applications on the platform

An important part of the CUBA user interface is the universal data filter, a component that allows users to create their own search conditions. It is enough for the developer to drag the component onto the browser screen (this is what we call typical screens for displaying the list of entities), and you can forget about it. Users and system administrators themselves determine what and how to search. The role-based access control subsystem allows, in runtime, to manage the availability of CRUD operations with entities or individual attributes, the visibility of screen components, as well as arbitrary tokens that can be created and used programmatically. Access control at the row level allows you to restrict access to certain data records. For example, users from the regional department will be able to see only documents created in this department. To top it off, all changes in the data are logged, so you will always see who changed what and when - it is very convenient when “debriefing”.

image
Universal Data Filter

In addition to the above, CUBA has other ready-made features out of the box, including:


What can I deploy my application to?


As for the implementation stage and environment options, here you have enough freedom of choice. Applications created on the CUBA platform can be deployed in various configurations, ranging from running all application components on one server to configurations that provide high fault tolerance, with separated web, middle and DB layers. The out-of-box platform supports PostgreSQL, Oracle Database, Microsoft SQL Server, MySQL, and HSQL (the latter is typically used for prototyping), between which you can switch as the project grows. It is also important to note that CUBA applications can be deployed on any Java EE Web Profile server, including Jetty, Tomcat, Glassfish, Websphere, etc. And of course, you can deploy your application to Docker and / or run it in any popular PaaS cloud like CloudFoundry, OpenShift or Jelastic. By the way, integration is implemented for Jelastic, which allows deploying an application in one click directly from Studio.

What you need to start writing applications on CUBA?


All you need to develop applications on CUBA is Java SE, XML and JPQL. This makes the code of your application as homogeneous as possible, and therefore easier to maintain. It also allows the development team to be more flexible - you do not need a separate group of web developers or gurus of Java EE.

You can write the business logic of the application in any familiar IDE, like IntelliJ IDEA or Eclipse, which is supplemented by CUBA Studio - a specialized IDE for automating a variety of platform related tasks, such as:


image

All changes between Studio and IDE are synchronized, so that you yourself can choose what to work. In addition, Hot deploy is implemented in Studio - all changes, except for the data model, including external changes in the Java IDE, are automatically compiled and deployed to the server without restarting (we wrote about our implementation of hot deploy earlier). As a result, Studio takes on most of the routine work - although if you prefer, you can work exclusively in the Java IDE. For example, for IntelliJ IDEA there is a great plugin .

If you need to migrate an outdated application onto a modern stack, CUBA can also be a good option. Studio has built-in migration tools that automatically generate a data model and CRUD screens based on the existing database, without changing the latter scheme. Of course, in any case, it will be necessary to port business logic and specific screens, but this significantly saves overall labor costs.

How active is the developer community? What if the platform is no longer supported?


Issues related to the development are discussed in free English - and Russian - speaking forums, most likely you will receive an answer to your question during the day. And, of course, commercial support and consultation options are available.

The picture below shows the launches of unique projects on Studio for August. Studio collects anonymous statistics only with the user's permission, so the list is far from complete. At the same time, over the eight months since the beginning of the year, the number of launches of the Studio has increased about 10 times and continues to grow rapidly, largely due to the recent transition to the open source model. We are constantly participating in Java conferences, which also contributes to the growth of the community: this year we were already at JavaZone in Oslo, QCon in New York, AADI in London, and soon we are going to JavaOne in San Francisco and JokerConf in St. Petersburg. Technically, the platform is developing no less active . It should be noted that all solutions of our company are built on it, which is an additional driver for support and development. By the way, the platform has recently been included in the register of domestic software - for some companies this may be relevant.

image

Open source = free?


Nearly. As indicated in the title, the framework itself is open source and distributed under the Apache 2.0 license, its source code is available on GitHub. This means that the use of the platform does not impose any licensing restrictions on the applications developed on it. CUBA Studio, in turn, is available in a free and commercial version. The free version of CUBA Studio is fully functional, but has limitations on the size of the application's data model. It is ideal for starting a project and exploring the platform’s capabilities. Further development can be continued absolutely free of charge directly in the Java IDE, or by purchasing a subscription to a commercial license, which also provides access to Premium add-ons: a report generator, charts and maps, full-text search, and BPM. The cost of an annual subscription for a single developer is 18,000 rubles, outside the CIS countries a bit more expensive - $ 389.

Hopefully, after reading this review, you have the idea of ​​the CUBA platform. If you have a desire to try it “in action”, you can simply download Studio without registrations and SMS , go through Quick Start and after a few minutes launch your first CUBA application. You can follow the news on the platform on Twitter , Facebook , Russian and English blogs - there are more posts in the latter now, but we plan to fix this soon!

Source: https://habr.com/ru/post/310148/


All Articles