-
1. Re: How to create layered Seam application
kukeltje Jan 5, 2008 3:59 PM (in response to jagin)I'm not an expert (and did not read the document in detail since most was a plain intro to seam), but wasn't (isn't) one of the goals of seam to get rid to this overly layered designs?
-
2. Re: How to create layered Seam application
jagin Jan 6, 2008 8:29 AM (in response to jagin)"kukeltje" wrote:
I'm not an expert (and did not read the document in detail since most was a plain intro to seam), but wasn't (isn't) one of the goals of seam to get rid to this overly layered designs?
For simple web application it's ok to have only model and actions but it's get more complicated with wider application where the business functions a called from many action/controller components or are called outside of the Seam.
What about database access, when you want to get the same data from different places. It's nice to have persistent layer where you get all database function in one place.
And the talk goes one :] -
3. Re: How to create layered Seam application
pmuir Jan 6, 2008 4:17 PM (in response to jagin)"kukeltje" wrote:
I'm not an expert (and did not read the document in detail since most was a plain intro to seam), but wasn't (isn't) one of the goals of seam to get rid to this overly layered designs?
+1, this is completely over the top layering. To summarize, this tutorial suggests:
Entities
DAOs
Services
Actions
Presentation Layer
which is totally unnecessary (especially both an action and service layer!). At least it doesn't suggest using DTOs ;)
My approach would be to start with a single layer, and if you find yourself reimplementing functionality, factor out *that functionality* into a separate layer.e web application it's ok to have only model and actions but it's get more complicated with wider application where the business functions a called from many action/controller components or are called outside of the Seam.
So, then factor out what you need to into a agnostic layer, and then call to that from Seam and your other app. Btw Seam supports EJB remote calls and WS calls.What about database access, when you want to get the same data from different places. It's nice to have persistent layer where you get all database function in one place.
Err, the entity manager and named queries? Or, take a look at the Seam Application Framework - none of this layering nonsense and all your CRUD and queries in one place :) -
4. Re: How to create layered Seam application
jagin Jan 7, 2008 2:35 AM (in response to jagin)Hmm... I'm from Appfuse framework school where we have all this layers (MVC pattern) so that's why I was looking for a like solution in Jboss Seam.
It looks like the way of using Jboss Seam is a bit different.
Thanks
Jarek -
5. Re: How to create layered Seam application
amitev Jan 7, 2008 4:35 AM (in response to jagin)In what situation it is better to create more-layered app?
-
6. Re: How to create layered Seam application
nickarls Jan 7, 2008 5:03 AM (in response to jagin)"amitev" wrote:
In what situation it is better to create more-layered app?
Job security. If you are the only one who can modify the code, you are safe ;-) -
7. Re: How to create layered Seam application
pmuir Jan 7, 2008 5:11 AM (in response to jagin)where we have all this layers (MVC pattern)
I don't think this is really the MVC pattern - the name gives away the layers MVC dsecribes - Model, View and Controller (no Service layer, no action layer, no DAO layer). -
8. Re: How to create layered Seam application
nickarls Jan 7, 2008 5:27 AM (in response to jagin)Owning a copy of Alur, Crupi & Malks "Core J2EE Patterns" myself, I was at first surprised by Seams heretic ways but I then started to realize the many of the patterns are trying to solve problems that really aren't there anymore.
Sure, you can look up your abstract factory through a service locator but what's the *real* use in that? Enjoy your classes, the time for interfaces and factories are when you really have two or more implementations of the same logic etc. -
9. Re: How to create layered Seam application
amitev Jan 7, 2008 5:31 AM (in response to jagin)In the sample project they don't use SMPC. They user @PersistenceContext and the dao's are application scope. No conversation usage at all - the "good" old stateless session facade.
-
10. Re: How to create layered Seam application
jagin Jan 7, 2008 5:39 AM (in response to jagin)Becouse EJB3 is a new topic for me i've started to think that layering is out of date for this technology and start to search something about this on the google.
I found some very interesting articles where people have the same dilema about layering an application:
http://www.adam-bien.com/roller/abien/entry/to_layer_or_not_to
http://www.infoq.com/news/2007/09/jpa-dao
http://www.adam-bien.com/roller/abien/entry/jpa_ejb3_killed_the_dao
http://gleichmann.blog.com/2054653/
So it seems that it is a wide topic and the matter of your application and its requirements.