-
1. Re: ..:: Questions about Seam design!!!
andre1001 Sep 13, 2006 3:05 PM (in response to angelogalvao)Hi Angelo,
do you have e-mail? I looking for Seam contacts in Brazil.
Thanks. -
2. Re: ..:: Questions about Seam design!!!
angelogalvao Sep 13, 2006 3:19 PM (in response to angelogalvao)"Andre1001" wrote:
Hi Angelo,
do you have e-mail? I looking for Seam contacts in Brazil.
Thanks.
angelogalvao@gmail.com -
3. Re: ..:: Questions about Seam design!!!
bfo81 Sep 13, 2006 5:40 PM (in response to angelogalvao)Seam still uses a 3-layered architecture. Ok, it breaks with traditional J2EE patterns like DAOs and stuff. But hey, this is called "progress". You do not need this fat old architecture paradigmas. Keep your code small, simple and maintainable. Seam enables you to do so ;).
-
4. Re: ..:: Questions about Seam design!!!
jbmadair Sep 13, 2006 6:05 PM (in response to angelogalvao)bfo81, if you'd like to use Seam with a separate back-end layer of any sort, it's quite easy to do so. Look at the CaveatEmptor CVS checkout from the Hibernate in Action book web site for nice generic DAO layer abstract classes if you're wanting to combine it with Hibernate.
I'd venture that you can pretty much always do without the DTO paradigm and just pass disconnected Hibernate entities back, even when you do want a DAO layer, perhaps excepting the case where you want a long-lasting API for published web services (for third parties).
I've had a lot of success so far working with a DAO layer, and in our case, a very large project that has a "business engine" that is accessed for multiple business lines and separate web-applications, it does seem appropriate and done right adds very little code overhead.
The best bit is that even with the layer in the back-end you can use components.xml to instantiate back-end entities and DAOs as Seam components in any scope without them having to have any Seam-specific coding. -
5. Re: ..:: Questions about Seam design!!!
fhh Sep 14, 2006 6:03 AM (in response to angelogalvao)Seam still uses a 3-layered architecture. Ok, it breaks with traditional J2EE patterns like DAOs and stuff. But hey, this is called "progress". You do not need this fat old architecture paradigmas.
But you can still use them if you want to. If it is necessary you can still have a session bean as a wrapper around the EntityManager. I sometimes use this pattern, if the retrieving of entities is more complex and does happen - at least sometimes - outside of seam. This is useful if you have MDBs and you don't want them to depend on seam so you can deploy them on another AppServer more easily.
Regards
fhh -
6. Re: ..:: Questions about Seam design!!!
nicola9000 Sep 14, 2006 9:58 AM (in response to angelogalvao)Hiya ,
Yes, traditional tiers are a bit mixed.
You can have a "navigation tier" in a finder that is "data tier", like in booking example.
I am thinking much and i think that the architectural new solution is "Bijection based"
I am writing my finders and i inject in them presentation objects.
So my finders are "clean" and they still are "data tier"
And i have Presentation objects and pure business objects, like always.
So you can reuse your data tier components, place them in a separate project that generates only a .jar ( i am doing so ). You could create a complete .ear that will be a "data tier object server", but this solution should be well evaluated.
(Sorry for my English)
good work, Nicola -
7. Re: ..:: Questions about Seam design!!!
gavin.king Sep 14, 2006 11:42 AM (in response to angelogalvao)I don't know why everyone is saying you can't use DAOs .... you can absolutely use DAOs if you want! There is no problem at all, just write an @Stateless bean with @Name("customerDao") and inject it into your action handler.
It's just that you don't really need DAOs these days - they smell of overengineering.... -
8. Re: ..:: Questions about Seam design!!!
angelogalvao Sep 14, 2006 1:10 PM (in response to angelogalvao)"gavin.king@jboss.com" wrote:
I don't know why everyone is saying you can't use DAOs .... you can absolutely use DAOs if you want! There is no problem at all, just write an @Stateless bean with @Name("customerDao") and inject it into your action handler.
It's just that you don't really need DAOs these days - they smell of overengineering....
I agree with you about about DAO's...
What i dont like is manipulate JSF components in the same method/Object that i save a entity for example... -
9. Re: ..:: Questions about Seam design!!!
bfo81 Sep 15, 2006 12:46 PM (in response to angelogalvao)I didn't say you CANNOT use DAOs anymore. I just said you CAN leave them out (in many cases).
Look at the AppFuse framework (Spring + Hibernate):
- Entity class
- DAO interface
- DAO implementation
- Manager interface
- Manager implementation
- Backing bean for presentation layer
*dooooh*
Same in Seam:
- Entity class
- Controller local interface
- Controller stateful bean
Yes, of course, there are many special cases. When using huge shared databases or whatever, then use DAOs. But in many cases it's not necessary.
Be courageous and don't use patterns you don't need just because others use to use them ;).