In our current app, which we want to move to Model 2, we have packages to
hold model, view, and controller classes. The view package holds servlets
that emit html to build/handle the HTML. The model package holds "pure"
business classes, lightweight ones to represent Account, Product, Region,
SalesRep, etc. The controller package holds a Datastore class that handles
all interaction with Oracle for the app, as a persistence layer. An example
would be a methods like:

Datastore.saveCustomer( Customer customer )
Datastore.saveRegion( Region region )

The servlets call this in response to form submissions, etc. The pure
'model' classes of course, have no knowledge of the view or controller, they
are just passed around like a cheap prostitute.

How is the persistence handled in your model 2 apps? It seems that to follow
what may happen if we get to EJB, we need a persistence class for each class
in our 'model' package, such as AccountDB, ProductDB, RegionDB, etc. Then we
have two places to make a change if a class gets a new property, for
example. It is even more if we come up with another platform to persist to,
such as SAP or another ERP.

Is this the case? I'm looking for a clean way to handle this.

Bill Hines

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to