Hi Michael, how does Castor integrate with struts? Is it completely seperated from the struts actions by your business objects?
I saw the list of castor exceptions and they didn't seem comprehensive, but maybe I'm wrong. Adam Michael Mok wrote: >Hello > >We are using Castor and have implemented a STRUTS based online reservation >system using CASTOR as our data access layer. Castor works well as the >functionalities it provides are non intrusive. What I meant is that it >provides a Mapping.xml file which maps your beans to each table (and even >views) in the database. In this file you define how you want to map your >beans to the tables, you get to define how you want the object to be cache >and what columns needs to be validated prior to update. Castor will >generate the required SQL in real time to perform the create, retrieve, >update and delete (CRUD) operations. Castor will also generate the correct >SQL syntax for Oracle, Sybase, MySQL etc. That way your application can be >made database independent as Castor generates SQL specifically for the >database which your application is accessing. This works well on a server >side application as the application is started once and stay resident (ie >SQLs are only generated when the application starts). > >Castor also provides a Database.xml file which you define how you want >Castor to connect to the database (eg JDBC driver or JNDI or connection >pool) > >I am not selling Castor, but just like to share my experience. > >Michael > > > >-----Original Message----- >From: Adam Hardy [mailto:[EMAIL PROTECTED]] >Sent: Thursday, 30 May 2002 17:33 >To: Struts Users Mailing List >Subject: Re: Design Advice - Relational Databases & Java Objects > > >Hello Jerome, >I'm not sure why I'm so bad at searching the net & not finding things >like this. ObjectBridge has a feature list that blows me away. Are you >using it? Castor also looks interesting. > >Why do you refer me to JBoss & openEJB? I've no experience with EJB, but >from what I know, I presume you mean that I could use these EJB >containers for their container managed persistence mechanisms - would >they fulfill the requirements of a data access layer? > >Thanks >Adam > > > >Jerome Jacobsen wrote: > > > >>Have you looked at these opensource projects? >> >>JBoss http://www.jboss.org/ >>OpenEJB http://www.openejb.org/ >>Castor JDO http://castor.exolab.org/ >>ObjectRelationalBridge http://objectbridge.sourceforge.net/ >> >>As for (1) I would have the business objects throw exceptions. I would >> >> >have > > >>the Struts Action convert exceptions to ActionErrors or ActionMessages as >>appropriate. >> >>As for (2) the answer depends on the capabilities of the data-access layer >>you are using. >> >>-----Original Message----- >>From: Adam Hardy [mailto:[EMAIL PROTECTED]] >>Sent: Wednesday, May 29, 2002 12:44 PM >>To: Struts Users Mailing List >>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]> >> >> >> >> >>-- >>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]> > > >-- >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]>