Oracle's J2EE Framework "Business Components for Java"
makes it very easy to read and write from collections
of values objects (sourced from the database) with
automatic interaction with business objects that
centralize your business rules, and handles the OR mapping
for your business objects. You pick the "shape" of
the data you need in your view layer, and it implements
all of the handlers for your value object collections
and optionally makes the value objects in these
collections transparently updateable, delegating 
changes back through your business object layer
with no yucky code you have to write yourself.

A whitepaper on all the capabilities is at:

http://otn.oracle.com/products/jdev/htdocs/j2ee_bc4j.html

If you've read the O'Reilly Struts book sample chapters
on TheServerSide.com, basically all of the Model Layer things
that Chuck describes in Chapter 6, "Struts Model Components"
as necessary pieces for your working Struts-with-Database-
and-Business-Logic application, the BC4J framework
implements for you. You basically just tell it the
tables you want to work with (for your BO layer), or
forward generate those tables from a BO object model
that you design, and then tell it what queries your
view layer needs to perform.

You don't need to write model layer plumbing code.

  -> Don't bother writing Value Object classes

  -> Don't bother writing JDBC code for queries

  -> Don't bother writing a class to expose your
     collections of value objects to the view layer

All of these things are done for you.

Plus, it works with any SQL database, not only Oracle. :-)

I'm planning a whitepaper that specifically illustrates
how to couple Struts with BC4J next.

__________________________________________________________________
Steve Muench - Developer, Product Mgr, Java/XML Evangelist, Author
Simplify J2EE and EJB Development with BC4J
http://otn.oracle.com/products/jdev/htdocs/j2ee_bc4j.html
Building Oracle XML Apps, www.oreilly.com/catalog/orxmlapp
----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 6:44 PM
Subject: Re: Design Advice - Relational Databases & Java Objects


| 
| 
| 
| Adam -
| 
| Have you looked at Torque from the Jakarta Tubine project?
| 
| I haven't used it but have heard good things about it. It provides an
| ability to perform O/R mapping using an XML configuration file - and (as I
| understand) it creates Java files for you that implement a peristence
| layer.
| 
| FWIW -
| Kevin
| 
| 
| 
| 
| Adam Hardy <[EMAIL PROTECTED]> on 05/29/2002 12:44:28 PM
| 
| Please respond to "Struts Users Mailing List"
|       <[EMAIL PROTECTED]>
| 
| To:   Struts Users Mailing List <[EMAIL PROTECTED]>
| cc:    (bcc: Kevin Bedell/Systems/USHO/SunLife)
| Subject:  Design Advice - Relational Databases & Java Objects
| 
| 
| Hi All,
| 
| I saw this thread in the archives and I thought I'd pinch the title.
| I've spent this afternoon surfing the web looking at stuff on Sun,
| Jakarta  and lots of smaller sites looking for a ready-made data access
| layer package but I take it there isn't an open-source one out there.
| 
| Obviously I don't want to tie my data access layer to struts, so there
| are a few questions I've got.
| 
| (1) Is it best for the data access layer to throw exceptions on error to
| be picked up by the business objects & then struts actions, or would it
| be good to use a struts-type message object and use strings in the
| application resources file (I'm just worried my exceptions' text would
| not be multi-lingual)
| 
| (2) How would I get the database connection info to the data access
| layer? Presuming I want to set it up in struts-config.xml or as in
| commons-dbcp, would I then pass it in from struts actions into the
| business object and then into the data access layer as a parameter on
| each call?
| 
| 
| 
| I've seen quite a few patterns like www.martinfowler.com and code like
| in Sun's Pet Store, so I think I've got a fairly good idea of what I
| need. The data access layer I want has got to:
| 
| - take as input and return as output Data Transport Objects
| - allow the business objects to control transactions
| - use a connection pool
| - possibly keep the SQL statements in an external XML file
| - have comprehensive error handling & reporting
| 
| 
| 
| 
| --
| To unsubscribe, e-mail:   <
| mailto:[EMAIL PROTECTED]>
| For additional commands, e-mail: <
| mailto:[EMAIL PROTECTED]>
| 
| 
| 
| 
| 
| 
| 
| ---------------------------------------------------------------------------
| This e-mail message (including attachments, if any) is intended for the use
| of the individual or entity to which it is addressed and may contain
| information that is privileged, proprietary , confidential and exempt from
| disclosure.  If you are not the intended recipient, you are notified that
| any dissemination, distribution or copying of this communication is
| strictly prohibited.  If you have received this communication in error,
| please notify the sender and erase this e-mail message immediately.
| ---------------------------------------------------------------------------
| 
| 
| --
| To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
| For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
| 
| 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to