How to write the structure of the project, its levels? At first, there seems to be one way for all subsequent packages ( java.com.corporation ).

  • .controlle - here are the controllers,
  • .entity - entities
  • .dao - a layer that provides access to the БД
  • .service is something like an intermediary between a DAO and for example a controller,
  • .heandler - as I understand the data handler,

but there are also other layers, such as: business , object , ...

Please beware of what levels there are and what their purpose is!

  • There are no clear rules. In some projects, packages are cut into layers, in others, by functional sections, in the third, by the boundary of the domain model, in the fourth, all are felled into one package. The main thing is that classes that are strongly associated with each other, have a common parent package. - Nofate

1 answer 1

Here is the structure of the project, but you can follow it - https://maven.apache.org/guides/getting-started/index.html#How_do_I_make_my_first_Maven_project . If you need a dao package, add it in the bottommost package, that is, under "coproration".

  • It's still Russian SO, and the link to the resource is in English. I think, “be taken aback clearly, what are the levels and what is their purpose” meant a little more :) - Ksenia
  • You can not read. There, after all, the main thing is the folder scheme. If I were not on Linux now, I would make a screen. And in Linux, to make any elementary action you need to spend half an hour. - Eugene