Spring Framework
jürgen höller [werk3AT] <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Jake, I just came across your mail at: http://barracudamvc.org/lists/archives/barracuda/2003-November/007057.html Regarding the Spring Framework's scope, it's basically about three layers: 1. the AOP-enabled bean container plus application context concept 2. the middle tier support: transactions and data access abstractions 3. the web support: web application context plus own web MVC framework Of course, there are many additional goodies like EJB support classes and support for lightweight remoting - but the above are the three basic layers. We take the layering very serious: We've even got production applications that use Spring bean containers within applets! There are also numerous people that use Spring to manage their business logic in Swing-based desktop applications. You're right that Spring's own web MVC framework directly competes with Barracuda. However, Spring's web MVC is truly just an option: We have many users that combine Struts, WebWork2, and Tapestry - respectively - with a Spring-managed generic middle tier. It's easy enough to even combine multiple web MVC frameworks within the *same* web application, accessing the same Spring root application context. I think the latter is what the original poster intended: To use Barracuda as web MVC framework on top of a generic Spring-managed middle tier, just like the above mentioned web MVC frameworks. If you're interested, we've got some articles on the subject: - http://www.springframework.org/docs/web_mvc.html (section 3) - http://www.springframework.org/docs/integration/tapestry.html There's also Don Brown's Struts-Spring plugin http://struts.sourceforge.net/struts-spring/ that follows a different approach than what we recommend, namely configuring Struts Actions in a Spring application context. I prefer to *access* Spring-managed business beans and resources from within web controllers, for clean separation between the tiers: Section 3 in the Web MVC article outlines how to do that. Furthermore, Atlassian recently implemented XWork/WebWork2 integration, following a proposal of mine. Beyond the straightforward way of fetching the Spring application context via the ServletContext (that works with plain WebWork and WebWork2), they introduced an "external-ref" mechanism for directly referencing specific Spring-managed beans. Regarding PicoContainer: You might be interested in section 6 of the article at http://www.springframework.org/docs/lightweight_container.html. In the meantime, Spring supports not only Type 2 IoC (JavaBean properties) but also Type 3 IoC (constructor arguments) with arguably more configuration options than PicoContainer (which just does Type 3). Note that the Spring bean factory (spring-beans-jar) is as lightweight as an XML-enabled PicoContainer. You've also asked why we provide our own AOP framework. Well, we've co-pioneered the area: Rod has founded AOP Alliance, and we're the first implementation of those interfaces. Our AOP support is at least as powerful as Nanning's, for example. We just do sophisticated method interception though, via J2SE proxies or CGLIB. AspectJ goes much farther in that it extends the language for intercepting field accesses etc. But Spring's real container power lies in the middle support: Our lightweight transaction support with pluggable transaction strategies plus declarative and programmatic demarcation is most popular, particularly in combination with the Hibernate support classes. Setting up resources and managing transactions without intrusion into application objects is a breeze, without the deployment hassle that comes with Local Stateless Session EJBs. Finally, sorry for the lenghty mail - I hope it made a few things clearer! If you've got any questions, feel free to contact me. I'll also be happy to help Barracuda users that attempt to integrate with a Spring-managed middle tier. As with Struts or WebWork, that shouldn't be harder than fetch a reference to the Spring application context via WebpplicationContextUtils.getWebApplicationContext(ServletContext). Regards, Juergen DI Jürgen Höller Senior System Architect ______________________________________ werk3ATS - division systementwicklung werk3AT informations- und mediensysteme europaplatz 4 A - 4020 linz t. +43 (0) 732 71 65 29 502 f. +43 (0) 732 71 65 29 3 mailto:[email protected] http://www.werk3at.com ______________________________________ werk3ATS - WIR ENTWICKELN ERFOLG