[Seaside] ROE - Public Store
Brett Taylor
brett.taylor at healthauditors.com
Wed Mar 31 20:01:49 CEST 2004
Travis,
The code is in the Smalltalk.ROE namespace. Is this how you would do
it? I originally did the class name transform manually. The code reads
a little better in my opion. I hadn't automated it so I went back to
the RA class name prefix to keep porting the code as simple as possible.
I might try using the Refactoring Rewrite Tool to automate the
translation of Class names (I always have to relearn how to use). I'll
give it a try and publish it.
Brett
On Wed, 2004-03-31 at 09:18, Travis Griggs wrote:
> Brett Taylor wrote:
> > Danil & Avi,
> > I think it would be great to get rid of the Squeak specific code in the
> > base as you have done. Did you implement support for other databases?
> > In order to support Oracle, I factored out an Abstract class like your
> > RARealRelation. I called it RADatabaseRelation. This allows the
> > resolution of some problems - but I also found there were issues I
> > couldn't resolve in this manner.
> > 1) Different SQL Syntax:
> > * Aliasing column names and table names is different between
> > Oracle &
> > Postgres
> > * No support for the LIMIT operator in Oracle
> > * Postgres EXCEPT operator is MINUS in Oracle
> > 2) Attribute to Colummn name mapping fails in Oracle
> > Oracle uses cases insensitive names by default. This causes
> > #resolveAttributeIn: aCollection to fail and
> > RARelation>>attributeNamed:ifAbsent: to fail.
> >
> > I resolved these problems by adding a couple of classes. First of all -
> > I created a class called the SqlDialect with subclasses OracleDialect &
> > PostgresDialect. These classes handle dialect specific name resolution
> > (through double dispatching) and determining which Printer class to use
> > for generating SQL code. I also created a new SQL printer class
> > RAOracleSqlPrinter which handles the differences in SQL code between the
> > dialects.
> >
> > There are other capabilities that are Database Driver specific such as
> > the ability to use bind variables and bind arrays. Support for these
> > can probably also be divided between the Relation, Dialect, and Printer.
> > What do you think?
>
> This is cool Brett. Thanks. I may load this if I have playtime Friday
> and play with it. I wonder if its possible to do some sort of transform
> where we strip the RA prefixes and put the code in a first class VW
> namespace.
More information about the Seaside
mailing list