-----Original Message-----
From: Robert J. Sanford, Jr. [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 5:59 PM
To: Struts Users Mailing List
Subject: RE: Persistence Framework Comparison?


There are two things that I want/need in a persistence framework and I
have yet to find them. I know that OJB does not support them and I have
not looked very hard at the others. Maybe you can tell me if Expresso
handles them.

1) Read only attributes so that a setter method is not automatically
generated for one and that value is never persisted, just read.

Expresso DB Object has recognise read only fields, such PRIMARY KEYS.
and also virtual fields, concocted field that don't actually
exist in the database table, that you create in Java and derive from
calculation.

2) The ability to persist an object to a different "table" than it was
read from. Yes this seems odd so let me explain in a few simple words
followed by a simplistic example. The simple words are - performance and
simplicity. When developing a web app database I tend to go for
normalization. The employees are in one table with a FK to the
department table. But, when displaying the data on a page I want to
display the name of the department, not its database ID. So, I use a
view that joins the two tables meaning that
   a) I get all the data that I need in a single query I can
      get all of the information I need for display (performance)
      and...
   b) I don't have to worry about reading data from multiple
      queries and/or multiple objects (simplicity).

In an ``enter new employee'' form you typically want to generate a HTML
drop list of departments, right ?
`SELECT DEPT_ID, DEPT_NAME FROM DEPARTMENTS'
So you need access to the department table.

Of course when you want to view the employee record, in Expresso you
can create Employee DBObject with valid values look up for virtual field
"department_name" for html option select. Expresso can also cache
these valid values for you as well. So you need not blast the database
with "SELECT DEPT_ID, DEPT_NAME ...." queries.

But, I cannot guarantee that the view I am reading from is updateable so
I have to insert/update to the simple tables (employee for instance).

So, can you help me out here? Can Expresso do this?

When caching is involved, you have two choices?

1) Blow out the caches.

2) Make sure the caches are big enough store all of the data,
entire population, and only update the database using Expresso
Admin or front end that you wrote using Expresso.

This is not also an issue for Expresso but also J2EE containers.
Namely EJB CMP implementation that support cacheable data.
What will typically happen is that Sys-Admin/ Sys-DBA will use
the Oracle front end SQLPLUS or ISQL or MYSQL to go "behind the cache"
and manually modify the static data, in which case you have no chance
except to (1), but it is not like you are going to add a department
every 10 minutes or so!

--
Peter Pilgrim
ServerSide Java Specialist

My on-line resume and for interview videos about myself, J2EE
Open Source, Struts and Expresso.
   ||
   \\===>  `` http://www.xenonsoft.demon.co.uk/no-it-striker.html ''


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

Reply via email to