lundi 9 novembre 2015

DTO's with Hibernate, Frontend Objects vs Backend Objects

I'm starting with Hibernate 4, in a web project with AngularJS, I have a doubt about a typical case when you want to use your Entity Java Classes (Hibernate) with you GUI, In one case I need to add two fields more: Type Name and User Name to show in the frontend, but this fields are in another Tables in my Model, the Object Template has only the id (ManytoOne).

Here the Question, what is the best Practice in this case, create a DTO's or add this new field's in your class, but without mapping with the DB?

Aucun commentaire:

Enregistrer un commentaire