October 29, 11:44
Hi Matt. Thanks for the kind words. I'm honored. I'd just like to correct one misconception about Rails.
When you write "something like Rails would never fly in Java because it appears to be tightly coupled to the database" that's not really true. Active Record (the ORM part of Rails) has a database abstraction layer embedded called Abstract Adapter, which all the specific adapters are implementing transparently.
Hence, your Rails application is not tightly coupled to a specific database, but rather to the Abstract Adapter interface. Since concrete adapters are just ~100 lines of code, it's pretty easy to implement your own adapter if the current offering isn't sufficient.
The PostgreSQL and SQLite adapters were implemented one the same day by one person (Luke Holden). There's a Microsoft SQL Server adapter just around the corner (by Joey Gibson) and I've heard of people working on Oracle and DB2 adapters too.
So the only tightly coupling going on is if you write database-specific SQL. On that account, I'm actually very sympathetic to Jeremy Zawodny's Database Abstraction Layers Must Die!. Chasing database abstraction without a specific business case asking for it is just something You're Not Gonna Need and it's certainly not doing The Simplest Thing Possible.
Challenge by klaus momberger on October 30, 14:09
I tried an Oracle Adapter, but put it on hold when I realized that active-record is using MySQL features not supported by Oracle (the LIMIT clause, particularly) . DB2 doesn't support it either, as far as I remember.
-klaus
Challenge by David Heinemeier Hansson on October 30, 14:12
LIMIT is mostly used as a performance optimization for finders such as find_first (that will only return 1 object, so pulling more rows would be silly) and occasionally specified as a parameter by the user. The latter could easily be solved by implementing the same behavior in the adapter itself.
So if LIMT 5,10 is called, you fetch the entire result set and do results[4...10] to archive the same effect.
Challenge by Will Drewry on October 30, 19:22
Re: tight coupling to the database
People can write ActiveRecord knock-offs that just ducktype with ActiveRecord, e.g. ActiveFS, ActiveNIS. Making a stand in for ActiveRecord isn't impossible at all and means that you aren't necessarily tied to any specific backend. Abstract adapters make it at least one hundred times easier though!
-wad
Challenge by David Heinemeier Hansson on October 30, 19:23
Right. One project is already doing just that: ActiveLDAP.
Challenge by Morten on October 31, 13:28
In Oracle you can use ROWNUM to implement LIMIT functionality.
Challenge by klaus momberger on October 31, 20:46
ROWNUM is irrelevant if you have an "order by", in this case you have
to use row_number() which is not generic. I know that active record can be ported to Oracle, but it is somewhat "tightly coupled" by its SQL dialect.
Challenge by Morten on October 31, 22:34
Lots of ways for making ROWNUM work with ORDER BY can be seen at: http://www.adp-gmbh.ch/ora/sql/examples/first_rows.html
Anyway - I don't know what the exact problem is, so I may be miles off..
Challenge by klaus momberger on October 31, 23:07
Nope, you are not, the page even mentions row_number(). ;-)
Challenge by internet casino on June 22, 6:41
You are invited to visit some relevant pages about internet casino internet casino http://www.scottishtutors.com/internet-casino.html ... Thanks!!!