Is it possible to use JBoss SEAM on an application that is not a WEB application?
I mean, is it possible to use seam in a back-end application that just offers functionality through remote EJBs or Webservices or MDBs or whatever? (ant therefore there is no http session or request). Does it make sense to use Seam in s开发者_Go百科uch scenario?
If so, how is it launched? Since in a web context a listener is declared in the file "web.xml", in the described scenario, where is Seam launched?
No, SEAM is JSP-based, which requires a servlet/JSP engine and a web container. It's neither possible nor desirable.
Creating a service-based back end that's independent of user interface is indeed a very good idea. You can use EJBs or Hibernate to accomplish that. But you don't need SEAM.
Seam is definitely not JSP based. It's arguably JSF centric, but you can use Wicket or GWT for your user interface as well.
A Seam based back-end only application is possible and, in my opinion, it makes perfectly sense if you plan to use some Seam features like Security, RESTEasy integration, the ability to use dependency injection in web services and the MDB facilities.
About the second question, that is how to launch it, in Seam2 you have to define a dummy war module with the filter needed for startup and shutdown. In Seam3, being based on CDI, you may be able to avoid it.
In EJB 3 world you already have good mechanisms of Dependency Injection, Transaction Management, EJB's have a clearly defined lifecycle. So I don't think Seam's extremely useful for EJB's, unless you wanna mix EJB with web technologies, like JSF, Wicket, etc -- in this case you benefit from the unified component model of Seam. You will have Seam's DI and resource management mechanisms, that abstracts differences between EJB's, Servlet's, JSF's aproaches to that.
Seam's main point is to seamlessly integrate different (mostly web) technologies.
That's why I think it doesn't make much sense if you are using EJB's alone.
精彩评论