Hacker News new | ask | show | jobs
by tinco 4374 days ago
Weird, I get the idea of defining a new web framework API, but why would you build everything from scratch? There's loads of very good open source code out there.

Why not fork DataMapper for Lotus::Model for example? Now you have some dodgy hand rolled library that's probably not seen enough eyes to be really production proof.

2 comments

Lotus::Model apparently depends on https://github.com/jeremyevans/sequel , which has been widely used in production similarly to DataMapper.
It seems you are right, my apologies, I clearly hadn't read deep enough. Still, Sequel is just an SQL abstraction. DataMapper is exactly what Lotus::Model is, a full model abstraction over databases, regardless of the querying language.

Some years ago I even implemented an XQuery querying backend for DataMapper, it was not much work at all, at a time where AR still had SQL code all through the base and Sequel was just in low profile development.

> It seems you are right, my apologies, I clearly hadn't read deep enough. Still, Sequel is just an SQL abstraction. DataMapper is exactly what Lotus::Model is, a full model abstraction over databases, regardless of the querying language.

AFAICT from reading the Sequel code (and especially the code for the existing adapters), there's no real hard dependency on SQL (since the adapter both generates and applies the query string), though there is a dependency on being able to map back and forth to SQL-like operations.

It shouldn't be impossible to write a driver for a non-SQL backend for Sequel, though it seems like it would be progressively harder the farther from the assumptions common to SQL its operation was.

Correct, it's not impossible, there was a proof of concept mongo driver: https://github.com/jeremyevans/sequel-mongo . I doubt it still works with current Sequel, though, as I only coded it for a lightning talk in 2010.
Sequel, (and Sequel::Model) is an absolute peach. The best ORM I've ever used.

EDIT: Lotus::Model barely seems to use Sequel. Maybe I missed it...

Sequel is way more actively supported/developed compared to datamapper. Last release of DM was in 13/10/2011...
It's not a choice between DataMapper and Sequel, they are not comparable. Anyway, I know it's not maintained anymore, that's why I suggested forking it.
Note that DataMapper does not implement the DataMapper pattern but the ActiveRecord pattern. Lotus::Model appear to aim to implement the DataMapper pattern. They're fundamentally different.