
We will discuss an approach to application design that stems from experience and reflection on how many applications are designed. It is called domain-driven development or design. domain driven designDomain-driven programming (DDP), or DDD in English, is a very likely solution if we need to manage clients, countries, or any other master data, or even more complex data. We'll need a screen to search, list results, add, edit, and delete records. DDD offers the possibility of simply designing the structure of our data—the classes—and having DDD generate the tables for storage and the views for all that functionality. The result is the creation of applications in an extremely productive and agile way, without losing the ability to perform complex data processing when necessary.
To better understand all these concepts, it's best to look at examples, and for this purpose the chosen framework is Openxava.
Openxava
It is an interesting product that meets the expected specifications of domain-directed programming, generating high-quality interfaces that can also be customized.
It's also very easy to install; once you download the zip file, it comes with an Eclipse workspace and Tomcat. Creating a new project is done through a task. ant, to which you only need to provide the name that the new application will have.
Next, we will build a simple program, writing a minimal amount of code, exploring the great possibilities of layout and data presentation, without resorting to any HTML.
A website will be developed to manage movies. That's all. Conceptually simple, even simpler to code.

The most striking feature is the annotations. It's beyond the scope of this document to detail how they all work. Of note @Entity This determines that a table with the deduced structure will be created. It will also generate all the logic for creating, modifying, deleting, searching, and generating reports for the entity.
We started Tomcat and upon accessing the web http://localhost:8080/App/m/Pelicula This is the result:

Also noteworthy is the annotation @Stereotype. It allows you to give the property a special presentation and validation. In the previous application, only the release date had one specified, which caused the calendar component to be generated in the form. But the framework has many more options.
Up to this point, we've described a class that generates a table—an entity class. But it's also possible to create classes whose sole purpose is data presentation, that is, generating views. And this is where OpenXava's great flexibility lies: it can be used to implement any functionality.
We're going to create the Index class, which, as its name suggests, will be the home page of the application we've already started. It will have this simple structure:

Next, we will implement the class that will load the previous lists from the Index class. We will call it IndexAction:

The declaration of this operation must be added to the file controladores.xml:

Finally, the declaration of this new module must be added to the file. application.xml as follows:

Therefore, this simple application will consist of two screens, or two modules: one for managing movies, and another we've called Index. In the first case, only the entity structure has been defined, and since the functionality is left as default, no further configuration was necessary. In the second case, the custom action of loading information required creating a new module. If it had been desired to override any default functionality, such as saving the entity, or if it had been desired to add more buttons to the screen, a new module would have had to be defined in a similar manner.
The annotation @View It determines the arrangement of properties on the screen, that is, the screen layout. In this example, static text acts as a header, and below it, two columns with two lists of movies. The semicolon (;) determines a line break, and the comma (,) indicates that an element will be placed after the first. This is how it will look:

The result is very interesting given that we haven't written any HTML. The static text resource was obtained by adding the property textoCabecera to the file a properties file as follows:
Header text = App for managing movies
There is also the option to internationalize the application.
Further information can be found on the project's official website:
And the reference guide:





