features frameworks are forgetting
Web Frameworks have been blowing up in popularity for over a year now. PHP has more than ten, Python has around five, and there's also Java and Ruby. Combined with the rise of fame for DOM and CSS and the "invention" of Ajax, you can't help but think that we're currently in a web development renaissance. However, with all these new technologies and projects emerging, some older ones are being buried.
Having just finished reading Beginning PHP and PostgreSQL, I realize how crippled most, if not all, ORM implementations are. OK, maybe they're not really crippled. Maybe it's their job to only provide data access. If that's the case, then I'm rather upset at how most frameworks choose to design their Model layer (the M in the MVC).
For those who are unaware, the Model layer in an MVC-style Web Framework is supposed to handle the access, retrieval, and validation of the data. In most instances, the only interaction the Model has with the database is reading and writing the data. Everything else is handled through extraneous code -- features such as validation, callbacks, and custom functions.
The kicker is that the database itself has the ability to handle these functions already. Custom data types, user-defined functions, triggers, views, constraints -- all of these have been features of PostgreSQL for years and MySQL is quickly catching up. So why ignore whole functions of the database and recreate the wheel? I would assume (though I don't have any factual data on hand) that by placing this logic closer to the data itself, the application would be much more quicker and efficient.
Also, I doubt that these functions just aren't being used. If that was the case, I think they'd have been removed from the database a long time ago. Further, it's hard for me to imagine databases of large e-commerce sites like Amazon or eBay not using them.
As most Web Frameworks are still in infant and beta stages, maybe it'll just be a matter of time until we see this level of data access incorporated. Personally, I hope so -- it'd be a shame to pass on years of database development only to risk the possibility of creating a sub-par version.
Tags: cakephp, database, django, framework, orm, postgresql, rails
