A question from theory. How to create entities (POJO) more correctly: as objects reflecting database rows or as objects displayed in the UI. Looked in the examples, everything is done differently.

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants aleksandr barakin , cheops , αλεχολυτ , Streletz , user207618 Sep 26 '16 at 4:51 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    Often they do both. And inside the application fields are poured back and forth. - iksuy
  • @iksuy Ie create separate POJOs for the database string, separately for the UI and somewhere in the Business Layer do they commute? - Artik
  • one
    Yes exactly. Depending on the number of layers of such POJOs, there may be not two, but more. - iksuy
  • And these objects, as I understand, must lie in the appropriate layers (entities of the database tables in DAO, entities representing the components of the window in the VM, etc.)? - Artik
  • one
    I'll leave a link here in case you want to invent your bike. - enzo

1 answer 1

As objects reflecting the name of the columns in the database

  • Well, opinions are divided. - Artik