[Rails] Re: The need of IDs in ActiveRecord

Eric Anderson eric at afaik.us
Wed Jan 12 00:44:56 GMT 2005


Florian Weber wrote:
> i'm curious though, how often do you use use rails AND lamp for the
> same db schema?
> 
> how often do you actually use the same db for multiple platforms?

I have found that when developing application (web-based, server-side or 
desktop-GUI) I often have to interface with an existing database 
platform. In the enterprise, customers have often invested a good amount 
of time and money into a system and they want their new systems to 
integrate with the old system in order to continue to reap the benefits 
of their investment into the old system.

It seems to me that what would be ideal is two have two different ORM 
libraries in Rails. One is the current ActiveRecord which assumes a 
certain database design so that it can reduce the amount of coding. The 
other uses various mapping files and custom code blocks to map the OO 
model to the relational model. That way if you are interfacing with new 
RDMBS data structures you can develop them to use a Rails-friendly 
schema. Or if you are interfacing with a existing RDBMS system that 
already follows the Rails schema closely you can use ActiveRecord. But 
if you have a completely different schema from what Rails assumes you 
could use a combination of mapping files and custom code to allow access 
to the legacy system.

If I can ever start getting Rails in the enterprise then that is what I 
will be trying to develop (or adapt from an existing library). An ORM 
that is interface compatible with ActiveRecord (so it feels 
comfortable), but allows for more complex and custom backend schemas. 
This way you get the best of both worlds. You can use ActiveRecord for 
the easy cases and the complex system for the hard cases.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://one.textdrive.com/pipermail/rails/attachments/20050111/f84a82ca/signature.bin


More information about the Rails mailing list