RubyFlow : Ruby Community Link Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

light_mongo: a lightweight MongoDB object persistence layer for Ruby

LightMongo is a lightweight Mongo object persistence layer for Ruby which makes use of Mongo's features rather than trying to emulate ActiveRecord. It's an interesting alternative to the already popular and somewhat awesome MongoMapper.

Comments

Does the existence of a lib/core_ext/* directory in any lib fire alarm bells with anyone else?

It's good the author avoids the urge to use ActiveSupport (or whatever does this stuff in Rails) as a dependency for something so trivial but polluting Ruby's namespace with #blank? methods for 2 (by my count) calls in persistence.rb still rubs me the wrong way.

It's all personal preference I guess but if you must alter the way Ruby behaves outside your library why not at least mixin a module rather than re-opening so I can guess which module is responsible for the pollution and either patch the code or remove the dependency.shanna - March 09, 2010 04:20
Shanna, good point. Post an issue on the github issues page and I'll scope its usage to the library's internals.Elliot Crosby-McCullough - March 09, 2010 09:17
Yet another reinvention of the wheel? I seriously don't get it. And it's not gonna stay "lite" if the author thinks about features like lazy loading queries, dirty attributes etc.solnic - March 09, 2010 13:46
Good to see I am not the only one to point out these things around here. Solnic is totally on track with his comment. Of course now he will be labeled a troll.AnonymousCritic - March 09, 2010 18:08
As long as it doesn't require ActiveSupport it already has a leg up on MongoMapper. Mark - March 09, 2010 18:32
If people didn't reinvent the wheel, we wouldn't have Nginx, Ruby, Nokogiri, or a whole ton of useful stuff. Alternatives keep things alive.PeterCooper - March 09, 2010 18:58
First of all, I love MongoMapper. I use it. It has everything I need. However, I can also see it from the author's perspective that you don't need all of it all the time. Why use Sinatra for example? Rails has most everything you need. Let everyone's ideas flow. If it's good, people will use. Anonymous Coward - March 09, 2010 20:04
It's good to have alternatives. I'm a big fun of alternative solutions. For instance I prefer Merb over Rails, DataMapper over ActiveRecord, Linux over OSX, Progress Rock over Pop etc. :) My point was that in this special case of MongoDB ORM there's no need to reinvent the wheel. Especially there's no need to start writing something that's supposed to be lightweight because it's impossible to support MongoDB features and keep the ORM lightweight.

Regarding "why do you need sinatra if you have rails"...it's a bad example. Why? Because *you need* sinatra if you're building *a small web app*. You don't need MongoDB if you're building something small, you need sqlite3. See my point?

ps. lol, I guess I am a troll right now :)solnic - March 10, 2010 08:20
And oh, ActiveSupport is now cherrypickable so I don't think it's wrong to use some of its libraries. Most of the ORMs will be using ActiveSupport soon. Just deal with it :)solnic - March 10, 2010 08:21
"ActiveSupport is now cherrypickable so I don't think it's wrong to use some of its libraries"

@solnic This is very OT but if AS is multiple libraries then it should be multiple gems so dependencies are clear without having to dig through source code. The mantra is "Do one thing well".

For example I'm personally not a fan of polluting Ruby with 'core extensions' at the library level especially when it happens through indirect dependencies. It would be nice to know up front when a gems dependencies are resolved so I can choose to avoid, patch or fork the library.shanna - March 11, 2010 01:54
Wedding stationery is hair extensions something that you cannot ignore while planning your wedding; but at the same time it can cost you quite a handsome amount if lace wigs you let yourself jump for costly designer wedding stationery or rampant ideas. If you want to stick to a budget arrangement, dress up games then you must know how to save on the stationery for weddings. bridesmaid dresses Amarriage itself calls for high expenditures which is why it is necessary that one tries to sensibly save where possible. wedding invitation wording But this does not mean poor quality.
wedding - May 07, 2010 04:48
If Lashair extensions
Vegasbridesmaids dresses appeals as thewedding invitations place to exchange wedding vows chances are you're going to have a wedding memory to last a mention hairstylesthe option of a very cheap Las Vegas wedding. Whatever reason you are planning your cheap Las Vegas wedding, dress up gamesit's important to know that you don't need to spend a fortune in Las Vegas. As a matter of fact, you can plan a cheap Las Vegas wedding that meets all your needs and every budget.


lixiaoyu - May 08, 2010 03:04

Post a Comment

Note: If you are a registered user, you can log in to populate these fields.

You may use ONLY these HTML tags to format your comment:
<a href="" title=""> <b> <blockquote> <code> <em> <i> <strong>
Do NOT use <p> tags. Just use newlines :-)

s
B willy
e
n
d
V willy
s
e
n
J willy
d
P bum