0

Is it the right way to use an entitymanager in a JSF-Converter?

Or is it better to set only the Id-Attribute(s) and let the viewbean calls the Entitymanager (or a service with an Entitymanager)?

The converter is used for a selectOneMenu. But I do not know how to implement a solution, I want to know, what is the better / cleaner way to do this.

Paul Wasilewski
  • 9,762
  • 5
  • 45
  • 49
schlagi123
  • 715
  • 4
  • 11

1 Answers1

0

In general software should be developed in multiple layers (Multilayered Architecture). Therefore a service which calls the entity manager to retrieve your objects is always a good way (SoC and KISS). Especially when you need access to the objects from multiple places (DRY).

Paul Wasilewski
  • 9,762
  • 5
  • 45
  • 49