Re: Best Practice - Create component by entity type?

2015-07-04 Thread Per Newgro
This sounds good. I already have a registry where i can register services in a decoupled way. With spring and @PostConstruct no Problem :-). I would ASK then every factory if it is responsible for my entity type. But i still see a problem here. How to prioritize factory if i have more than one

Best Practice - Create component by entity type?

2015-07-03 Thread Per Newgro
Hi, i think about that problem for some time now. Maybe someone alrady has a good solution. Let's assume we have a Manager entity and a Tainee entity. Both are Person entities. In Model we ask for all persons. So we get a mix from Managers and Trainees in a list. Both concrete entity types

Re: Best Practice - Create component by entity type?

2015-07-03 Thread Rob Audenaerde
Hi Per, You can do something like this: Create a set of compontents that will be your panels to display specific Persons. Let's call them PersonPanels. You can introduce a PersonPanelFactory, which might give you the appropriate PersonPanel based on the class of the Person ( person.getClass()