Martin Naskovski wrote:
Hello all. Is there an app that demonstrates the use of Struts & EJB as a persistence layer? I checked out Struts-Resume from Matt Raible, but it uses Hibernate... Is there anything available w/EJB's? Thanks.
http://xpetstore.sf.net/
There are two implementations of Xpetstore, one that uses EJB and one that just uses servlets. Check out the EJB one, it works great with JBoss.
Note, I personally don't think that using EJB is fundamentally different from any other persistence layer, at least not in reference to Struts, so you should be able to look at just about any sample code and figure out some best practices. It all boils down to the fact that you have Struts Actions, which receive HTTP requests from the client, and which then delegate the work to other objects. Whether those objects are session beans that perform some task by calling EJB or Hibernate objects, or whether you're going the simple route (what I'm doing b/c my needs are so trivial) and just having your Struts Actions directly manipulate Data Access Objects which use JDBC business delegates, it's not really much different.
The only big difference I've seen is that some people believe you should abstract your model into a layer just beyond Struts Actions so that you can switch from Struts to another framework if necessary. But the other line of reasoning is that this is a lot of extra work if you have no plans to leave Struts.
My 2 cents.
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]