aspose file tools*
The moose likes JBoss/WildFly and the fly likes seam contrary to MVC ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "seam contrary to MVC ?" Watch "seam contrary to MVC ?" New topic
Author

seam contrary to MVC ?

anagha desai
Greenhorn

Joined: May 08, 2008
Posts: 22
Hello ,
Am trying to explore SEAM and after looking at the first example my views are ::

Using EL we bind the data to a backed up bean
( advantage being no need to manually set values )

Backed up bean needs to have wo annotations
@Name & @Scope

Action Listener is bound to the UI using a annotation of @In

After looking at all of this * am used to developing apps using struts )

I find struts much cleaner and much more layered

Seam in an attempt to avoid XML seems to have annotations freely thrown around

My understanding is SEEMS totally violates MVC - here the View is configured with Model

I am new and maybe I do not understand the details - but to my novice eye
is SEAM really worth it ?

Also is it app server independent or is it something specific to Jboss ?

People complain about the struts-config file being monolithic - but my arguement is atleast you have all config elements at one place !

Final question - and this frustrates me the most ( maybe I should leave software ! ) - why is there a need to change what works well in struts with the introduction of JSF / SEAM

Am expecting to be smacked over my head - but I need to vent my frustrations !


Regards,
-anagha
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

Seam is not specific to JBossAS. You can run Seam in any app server.

I particularly like that fact that the View and Model are more integrated. I very much disliked, in Struts, having to use one bean to hold form data, and then to copy, and possibly convert, that data to another bean (typically, a DTO), which was then given to the data (where the data was copied yet one more time). Not only does copying data from one place to another slow the application down, but it also tends to generate more garbage which then has to be collected.

Also, just because the View can make use of the Model objects directly does not mean that MVC is broken.


JBoss In Action
Nikos Pougounias
Ranch Hand

Joined: Jan 16, 2008
Posts: 110
By the way, what is your opinion about Wicket?


Nikos' Java blog
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

Sorry, but I have not used Wicket. But it is on my list of things to learn.
Javid Jamae
Author
Ranch Hand

Joined: May 14, 2008
Posts: 198
JSF follows a more traditional GUI-application MVC pattern, whereas classic Struts follows an MVC2 pattern which is a variation of MVC that is more page based than component based.

Seam acts as the glue between JSF and EJB (and other technologies) allowing you to use an object that has already been populated by one framework in another without having to create copies of you objects or create parallel class hierarchies.

There are several presentations / demos available on the Web. Take a look, and then try to build something yourself and see how you like it.


Author: JBoss in Action, javidjamae.com, @javidjamae on Twitter
Padmarag Lokhande
Ranch Hand

Joined: May 29, 2008
Posts: 93
It's ok using MVC, design patterns and all, But we should not lose focus of the task that we want to achieve.
e.g.,We use DTO to transfer data between the layers and to improve performance. While this is correct in theory, very rarely do we make remote calls where this pattern is really needed.
AFAIK majority of the applications do not use remoting. So if Seam allows us to reduce some layers, there's no harm in it. If anyone is comfartable with Struts, they can of course continue to use it.
Also refer to Martin Fowler's treatise on Anemic Domain Models at his website.


- Padmarag Lokhande
SCJP5 - http://blog.padmarag.com
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: seam contrary to MVC ?