V
V
Vladislav Kutas2018-10-28 14:00:20
Java
Vladislav Kutas, 2018-10-28 14:00:20

How to split a Java application into layers/modules (JavaFX + Hibernate + PostgreSQL + Maven)?

I am developing an application for maintaining production documentation in a small enterprise (training project). The application allows you to view and add entries in electronic logs, such as the "Fire Alarm Check Log".
The current version is being developed as a stadalone application. JavaFX is used as GUI, database - PostgresSQL, build system - Apache Maven, ORM - Hibernate.
A mandatory requirement is the presence of a separate application (not through a browser).
In the future, it may be necessary to create a Web interface with the ability to read data only and transfer the application to a client-server architecture.
1. How to split the code into layers in this case?
2. How to break this into modules in intellij idea?
At the moment I did it like this:

spoiler
5bd5923e64940288759333.png

But there are doubts, with this approach, the modules will not be completely isolated from each other, and in the future, when a new link is added to the system, most of the code will have to be rewritten.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asd111, 2018-10-29
@ThreeDogNight

You end up with a typical MVC pattern i.e. model(persistent) view(ui) controller(logic).
It's a normal design pattern, it's often done this way. Those. when logic is written in the controller, work with data in models, and work with appearance in views.
If you want something else, then look at the MVVM template i.e. model view viewModel is also a popular pattern and they say it is better than MVC, although everything also depends on the hands of the developer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question