Prev | Current Page 442 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"

disconnect if dbiexamp
end
As you can see, all the basic CRUD operations are supported and easy enough to achieve.
They just require a little more typing than their Active Record alternatives; there are no builtin
helpers to abstract the SQL language, and you need to handle the opening and closing of
your connections directly. Of course, many old-school developers coming from languages like
Perl or Java are used to doing this type of work.
Og
Og is short for ObjectGraph and is probably the most full-featured Ruby ORM library alternative
to Active Record available today. It was designed for handling the model section of the
Nitro framework (a Ruby framework alternative to Ruby on Rails).
Og takes a slightly different approach to the ORM design pattern than Active Record. With
Active Record, you define your database schema first and then Active Record creates the Ruby
CHAPTER 8 ?–  ACTIVE RECORD AND THE REAL WORLD 197
objects from that information. With Og, you define the Ruby objects, and Og takes care of
creating the database schema for you.


Pages:
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454