-
1. Re: EntityHome usage recommended?
hstang Jul 10, 2007 11:34 AM (in response to maku01)"maku01" wrote:
Hi,
Is the usage of it recommended?
Depends if you find the barebones of EntityHome is sufficient for managing your entities. Even if it's not, you can always override it. It's basically an Entity-managed DAO. I use it and find it quite useful especially for code re-use. There are actually examples in the Seam distribution that uses entity homes. Can't remember them off the top of my head though but it's there. -
2. Re: EntityHome usage recommended?
matt.drees Jul 10, 2007 12:38 PM (in response to maku01)the ui example uses one (defined in components.xml)
-
3. Re: EntityHome usage recommended?
matt.drees Jul 10, 2007 1:16 PM (in response to maku01)So, after a little searching...
contactlist, dvdstore, quartz, seampay, wiki, and ui each use EntityHome.
Overriding EntityHome is used in quartz, seampay, and wiki.
Defining entity-home in components.xml is used in contactlist, dvdstore, quartz, seampay, and ui.
seampay, interestingly enough, both overrides EntityHome *and* defines it in components.xml (<pay:payment-home>), which I hadn't realized you could do... -
4. Re: EntityHome usage recommended?
maku01 Jul 11, 2007 1:30 AM (in response to maku01)"matt.drees" wrote:
So, after a little searching...
contactlist, dvdstore, quartz, seampay, wiki, and ui each use EntityHome.
Overriding EntityHome is used in quartz, seampay, and wiki.
Defining entity-home in components.xml is used in contactlist, dvdstore, quartz, seampay, and ui.
seampay, interestingly enough, both overrides EntityHome *and* defines it in components.xml (<pay:payment-home>), which I hadn't realized you could do...
I can not find the usage of EntityHome in the examples you mentioned. (I use Seam 2 Beta) EntityHome programmaticaly used is in wiki, quartz and seampay examples. But my point is that there is no continuous strategy of the usage visible (at least for me).
I consider to use EntityHome as Base class for my DAO classes. But I'm not sure wheter it would be a good decision. -
5. Re: EntityHome usage recommended?
matt.drees Jul 11, 2007 1:46 AM (in response to maku01)I think EntityHome is intended to be a tool that you can use however you want to use it; there doesn't appear to be one Right Way.
So, if I were you, I'd give a shot at building DAOs on top of EntityHome, and if it doesn't fit well, try something else. I'm experimenting a bit in my app, and I haven't quite figured out what I like best. -
6. Re: EntityHome usage recommended?
denis-karpov Jul 11, 2007 7:06 AM (in response to maku01)What ever you do, you will need some functionality in your application that is already in EntityHome. At least, I suggest you to examine sources of it and catch the ideas and approaches . Then you can try to reuse it.
-
7. Re: EntityHome usage recommended?
maku01 Jul 11, 2007 10:16 AM (in response to maku01)"denis-karpov" wrote:
What ever you do, you will need some functionality in your application that is already in EntityHome. At least, I suggest you to examine sources of it and catch the ideas and approaches . Then you can try to reuse it.
I know, I already have a common class which is responsible for generic tasks like update, remove and so on. But I thought it would be better to use one base class which is written by an orm and hibernate and jpa guru like gavin king (and jsf and seam of course) :-)
What I not really like with the EntityHome approach ist the boundary to JSF (e.g. the automatically generated messages as result of an db operation) and the membering of the entity instance. Additionally in my base dao class I've generic list methods and I feel that the membering of the instance doesn't fit so well! -
8. Re: EntityHome usage recommended?
matt.drees Jul 11, 2007 11:06 AM (in response to maku01)As a thought... you may find it useful to subclass MutableController, or PersistenceController, or Controller.