Our handling of type for "integer" type columns used as row identifiers
could use some work.  I have started on this as it was being discussed
wrt Scarab.  But since I am assuming this should become integral to the
torque om/peer generation, I would put it up for opinions.

First of all let me state that the following discussion is not related
to enforcing a character column type for primary keys in the database,
this should remain flexible, and in most cases an INTEGER column type is
the best solution, though some apps may require a character type.

Originally, the OM/Peer model was written to use an int type for id's. 
This was altered quite some time ago to Object.  The idea being to
support any appropriate type  (Integer, Long, BigDecimal, and String
being the likely candidates.)  

I would like to do one of the top 2 things:

1.  Settle on using String as the PrimaryKey type.
2.  Add a Key class that would be used as the type, I would like this to
be backed by a String property.
3.  Same as 2, but allow the property to handle Integer, ... as well as
String.

1.
Advantages
a.  simple
b.  more memory efficient than the extra object used in 2 and 3.
Disadvantages
c. less efficient than the Numeric types.

I think the inefficiencies of the String compared to Integer for example
are offset to a great degree in that we are often having to convert
to/from a String representation of the id anyway.

2. 
Advantages
a. OO design
b.  could help reduce the String parsing needed when a compound key is
made from several columns.
Disadvantages
c. inefficient - especially when pulling object from storage using them
for a couple simple operations and throwing them away.

3. 
Advantage
a. Could potentially be more efficient than 2.
Disadvantage
b. Intake and Torque could potentially hide the complications, but I am
having trouble figuring out how. :)

As a final note, let me state that torque objects need to quit referring
to foreign key columns using primitive types like "int".

Comments?

John McNally


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to