Ruby ORM

Hello,

which is the best ORM for ruby?
and, is ORM really good on database handling?

Thanks.

···

--
Kind regards,
Zuer (祖儿)

I've been writing Ruby for three days now. DataMapper seems very good. There are several benefits to ORMs; not the least of which is being able to change the schema in your datastore without breaking all the client code that accesses it.

Sam

···

On 11/11/10 14:43, zuerrong wrote:

Hello,

which is the best ORM for ruby?
and, is ORM really good on database handling?

Thanks.

It all depends on what you want exactly. A Database ORM is an abstraction of
a database, that inherently introduces compromises in how you work with it.
The Ruby ORMs are quite famous - ActiveRecord made a huge case for ORMs all
on its own. DataMapper is an excellent purist ORM. Also in Ruby you should
consider the Sequel library, which includes an ORM layer (not as abstracted
as either AR or DM, but that may be a really good compromise when dealing
with legacy schema).

As a rule, I think the Sequel library may be unfairly overlooked in the
'good ways to deal with databases category'.

There are genuinely good reasons for using ORMs in many cases, but usually
the reason to use an ORM is to hide the nuisance of SQL. This means that
ORMs can often be used in situations that they really shouldn't. I think
Sequel goes a huge way towards making SQL a lot easier to use in a program,
and therefore ORM layers can be introduced on their merits.

That said, I haven't used Sequel in anger, favouring DataMapper in my Ruby
programs.

···

On Thu, Nov 11, 2010 at 1:43 AM, zuerrong <zuerrong@gmail.com> wrote:

Hello,

which is the best ORM for ruby?
and, is ORM really good on database handling?

--
http://richardconroy.blogspot.com | http://twitter.com/RichardConroy

ActiveRecord, it is the default for Rails, and thus has a huge community
behind it. That counts for a lot, it means problems get found and fixed, it
means people write subsidiary gems and plugins around it to add in
functionality for all sorts of things. It means any Rails book you go
through will teach you about it (ie the canonical AWDWR) it means there are
_really_ good guides at guides.rubyonrails.org (DataMapper has pretty decent
guides too, and since it implements a lot of the ActiveRecord api, it is
pretty intuitive after you know AR).

It's downside is that it is cumbersome using it outside of Rails.

···

On Wed, Nov 10, 2010 at 7:43 PM, zuerrong <zuerrong@gmail.com> wrote:

Hello,

which is the best ORM for ruby?
and, is ORM really good on database handling?

Thanks.

--
Kind regards,
     Zuer (祖儿)

I was thinking about this last night and it's part of a belief I have
that you reuse powerful facilities available to you rather than imitate
them or bodge them into Ruby. That's how scripting languages started -
simple programming interfaces to applications, operating systems etc.

If you want to script a web site then don't struggle with Ruby-like
libraries, run Internet Explorer and script its model. Nothing you can
download from rubyforge is ever going to be as big, sophisticated and
tested. Similarly with spreadsheets - Excel is on your computer, why
mess with anything less? Fire up win32ole and the World is your oyster.

···

--
Posted via http://www.ruby-forum.com/.

If you do use Windows I really recommend reading

Orchestrating all these rich and hugely powerful applications (eg
putting all your Itunes items in formatted spreadsheets) just seems such
an exciting way to use Ruby, generally speaking with not many lines of
code, because you are leveraging (I'm English really) all the work of
many other programmers.

I'm assuming that for every Windows thing I mention there is an exact
analogue in the Linux and Mac worlds. I'm not supporting Windows itself,
just the principle of reusing software.

···

--
Posted via http://www.ruby-forum.com/.

I propose not to wait until you get enough cash to buy different goods! You should get the <a href="http://bestfinance-blog.com/topics/personal-loans">personal loans</a> or consolidation loans and feel yourself free

Another downside is that almost every tutorial, howto, or book that gives
you a decent bit of help getting familiar with it assumes that you are
using it with Rails, which makes it kind of a pain in the butt to learn
to use effectively *without* rails.

···

On Thu, Nov 11, 2010 at 04:31:28PM +0900, Josh Cheek wrote:

ActiveRecord, it is the default for Rails, and thus has a huge community
behind it. That counts for a lot, it means problems get found and fixed, it
means people write subsidiary gems and plugins around it to add in
functionality for all sorts of things. It means any Rails book you go
through will teach you about it (ie the canonical AWDWR) it means there are
_really_ good guides at guides.rubyonrails.org (DataMapper has pretty decent
guides too, and since it implements a lot of the ActiveRecord api, it is
pretty intuitive after you know AR).

It's downside is that it is cumbersome using it outside of Rails.

--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

Sam Duncan wrote in post #960638:

There are several benefits to ORMs; not the least of which is being able
to change the schema in your datastore without breaking all the client
code that accesses it.

This is what worries me about the descent of human kind into the cess
pit of ORMs.

Sam I'm sure you're a decent person but it's actually the opposite.
Databases are supposed to be designed with external schemas ie you never
program to a base table...ever! You program to views, and then you can
change the physical database to your heart's content, even splitting
across nodes. Facades weren't invented by the Gang of Four, they've been
a part of computer science for half a century.

Databases have a wealth of logic, elegance and functionality. Slapping
them in the crude harness of ORMs is a most unfortunate and regressive
trend.

···

--
Posted via http://www.ruby-forum.com/\.

Sequel is very good. Its dataset based and therefore quite flexible.
ORM is optional and a wide array of plugins are available.

On the other hand it's can get complicated to configure, though this
is more a result of its ability to meet a user's complicated data
requirements. Setting up basic ORM functionality is seamless.

ActiveRecord is great, but the "convention over configuration" aspect
might be surprising for newcomers, particularly if they're not
creating their DB from scratch or if they're trying to map exotic
relationships and multi column primary keys (not sure if/how version 3
changes this).

-Skye

···

On Nov 10, 6:18 pm, Richard Conroy <richard.con...@gmail.com> wrote:

As a rule, I think the Sequel library may be unfairly overlooked in the
'good ways to deal with databases category'.

I was thinking about this last night and it's part of a belief I have
that you reuse powerful facilities available to you rather than imitate
them or bodge them into Ruby. That's how scripting languages started -
simple programming interfaces to applications, operating systems etc.

I am pretty sure that's not how Ruby started.

If you want to script a web site then don't struggle with Ruby-like
libraries, run Internet Explorer and script its model.

What does it even mean?

Nothing you can
download from rubyforge is ever going to be as big, sophisticated and
tested.

As buggy? IE is least capable. We have open source mozilla, open
source Webkit, why IE?

Similarly with spreadsheets - Excel is on your computer, why

mess with anything less? Fire up win32ole and the World is your oyster.

Excel is not on my computer. And neither it is on my server. And win32ole
won't fire, because I am on OS X.

Regards,
Rimantas

···

--
http://rimantas.com/

I was thinking about this last night and it's part of a belief I have
that you reuse powerful facilities available to you rather than imitate
them or bodge them into Ruby. That's how scripting languages started -
simple programming interfaces to applications, operating systems etc.

I understand that you might not be capable or want to rewrite things,
but where in this whole message is anything powerful referenced?

If you want to script a web site then don't struggle with Ruby-like
libraries, run Internet Explorer and script its model. Nothing you can
download from rubyforge is ever going to be as big, sophisticated and
tested. Similarly with spreadsheets - Excel is on your computer, why
mess with anything less? Fire up win32ole and the World is your oyster.

This didn't exactly make sense to me, but you're welcome to develop
for IE using whatever languages you'd like.

As for me and my house, we will serve the rubies.

~Johnneylee

···

On Fri, Dec 3, 2010 at 12:49 AM, Mike Stephens <rubfor@recitel.net> wrote:

--
Posted via http://www.ruby-forum.com/\.

If you want to script a web site then don't struggle with Ruby-like
libraries, run Internet Explorer and script its model. Nothing you can
download from rubyforge is ever going to be as big, sophisticated and
tested. Similarly with spreadsheets - Excel is on your computer, why
mess with anything less? Fire up win32ole and the World is your
oyster.

Thanks!

I'm really excited about scripting Excel with Ruby, because I
currently use a legacy system which involves injuring myself with a
hammer :slight_smile:

Johnny

I was thinking about this last night and it's part of a belief I have
that you reuse powerful facilities available to you rather than imitate
them or bodge them into Ruby. That's how scripting languages started -
simple programming interfaces to applications, operating systems etc.

While Ruby is a scripting language, too, it does not follow that it
has the same origin as the first scripting language that evolved
(which would that be, anyway? sh? Something even older?).

If you want to script a web site then don't struggle with Ruby-like
libraries, run Internet Explorer and script its model.

I want, nay, need, a Ruby-like interface to IE, though. Nothing is as
annoying as mixing a dozen paradigms across the board.

Also: I'd script WebKit with V8 support. It's fast, and cross-platform.

Nothing you can
download from rubyforge is ever going to be as big, sophisticated and
tested.

There is one good thing about the UNIX culture: "Programs should do
one thing, and do it well." The Ruby community soaked that up, and
applied it to libraries.

And with TDD/BDD/testing in general, your point about testing becomes
moot. Not to mention that, if a gem is open source, I can always fork
it and keep it going, instead of being beholden to one single entity.
Ain't that right, Oracle?

Similarly with spreadsheets - Excel is on your computer, why
mess with anything less? Fire up win32ole and the World is your oyster.

You are serious, I'm afraid. So: Excel is good, for a spreadsheet
program. But can it solve linear equations? Inverse a matrix (for the
curious: It can, but boy it ain't pretty)?

Not to mention that you have to rely on Excel being correct when, say,
importing CSV, or exporting TSV. Which you can't.

Also: Excel isn't necessarily installed on a computer, just like IE.

Last but not least: Excel only was possible because VisiCalc was
first, and because Lotus 1-2-3 kept the competition going. IOW:
Applying your "DRM" "principle" to Excel: Don't Repeat VisiCorp.

Wake up, and smell the world beyond what Dell sold you, Mike.

···

On Fri, Dec 3, 2010 at 9:49 AM, Mike Stephens <rubfor@recitel.net> wrote:

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.

I take it you aren't a fan of portability -- and prefer rewriting one
thing for eight different platforms.

···

On Fri, Dec 03, 2010 at 05:49:54PM +0900, Mike Stephens wrote:

I was thinking about this last night and it's part of a belief I have
that you reuse powerful facilities available to you rather than imitate
them or bodge them into Ruby. That's how scripting languages started -
simple programming interfaces to applications, operating systems etc.

If you want to script a web site then don't struggle with Ruby-like
libraries, run Internet Explorer and script its model. Nothing you can
download from rubyforge is ever going to be as big, sophisticated and
tested. Similarly with spreadsheets - Excel is on your computer, why
mess with anything less? Fire up win32ole and the World is your oyster.

--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

What does this have to do with the "ORM's Don't Do It" thread?

Don't thread hijack. Man up and hit "new message".

···

On Dec 3, 2010, at 00:49 , Mike Stephens wrote:

I was thinking about this last night and it's part of a belief I have
that you reuse powerful facilities available to you rather than imitate
them or bodge them into Ruby.

Why?

···

On Fri, Nov 12, 2010 at 5:47 PM, Mike Stephens <rubfor@recitel.net> wrote:

Databases have a wealth of logic, elegance and functionality. Slapping
them in the crude harness of ORMs is a most unfortunate and regressive
trend.

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.

Databases are supposed to be designed with external schemas ie you never
program to a base table...ever! You program to views, and then you can
change the physical database to your heart's content, even splitting
across nodes.

Wow, there is a lot for you to learn yet… A good start would be limitations
of views.

Regards,
Rimantas

···

--
http://rimantas.com/

What happens when I want to make an update :frowning:

···

On Nov 12, 8:47 am, Mike Stephens <rub...@recitel.net> wrote

Databases are supposed to be designed with external schemas ie you never
program to a base table...ever! You program to views

Too kind! From a pragmatic perspective an ORM is certainly not the opposite of providing flexibility. Horses for courses. There are a lot more ways to store data than SQL databases ;]

Sam

···

On 13/11/10 05:47, Mike Stephens wrote:

Sam I'm sure you're a decent person but it's actually the opposite