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

0 like 0 dislike
19 views
Develop an application to maintain production documentation for a small company (educational project). The app allows you to view and add notes in electronic journals, such as "Log of inspections of fire alarm systems".
The current version is developed as a stadalone app. As the GUI uses JavaFX, database Postgres SQL, build system: Apache Maven, ORM - Hibernate.
Mandatory requirement - a separate application (not through browser).
In the future, possibly, will require the creation of a Web interface with the possibility of only reading data and an application in a client-server architecture.
1. In this case, it is to break code into layers?
2. How to break it into modules in intellij idea?
At the moment, did the following:
spoiler
5bd5923e64940288759333.png
by | 19 views

2 Answers

0 like 0 dislike
You did the typical MVC pattern i.e. model(persistent) view(ui) controller(logic).
This is a normal design pattern so often do. Ie, when the logic written in the controller, data models, and work with the appearance in the vyuha.
If you want something else then look at the MVVM pattern i.e. model-view-viewModel -too popular pattern and say it is better than MVC, although there, too, everything depends on the hands of the developer.
by
0 like 0 dislike
It is quite acceptable. The main thing is not to get confused which data go between the modules.

For example, logic-persistance exchange Entity; and ui-logic - DAO.

Then change the format of the database will not affect the UI (because the task of logic is to interpret the database as this is useful for UI), and Vice versa - a change on the UI will not affect the database (e.g., changed text to select)/
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,729 users