lib/og.rb in og-0.11.0 vs lib/og.rb in og-0.12.0

- old
+ new

@@ -1,8 +1,8 @@ # * George Moschovitis <gm@navel.gr> # (c) 2004-2005 Navel, all rights reserved. -# $Id: og.rb 266 2005-02-28 14:50:48Z gmosx $ +# $Id: og.rb 270 2005-03-07 17:52:16Z gmosx $ require 'glue' require 'glue/logger' require 'glue/attribute' require 'glue/property' @@ -13,11 +13,11 @@ require 'glue/validation' # Og (ObjectGraph) is an efficient, yet simple Object-Relational # mapping library. # -# == Features +# === Features # # The library provides the following features: # # + Object-Relational mapping. # + Absolutely no configuration files. @@ -28,31 +28,43 @@ # + Serialize arbitrary ruby object graphs through YAML. # + Connection pooling. # + Thread safety. # + SQL transactions. # + Lifecycle callbacks. +# + Lifecycle observers. # + Transparent support for cascading deletes for all backends. # + Hierarchical structures (preorder traversal, materialized paths) # + Works safely as part of distributed application. # + Simple implementation. # -# == Meta language +# === Meta language # # primary_key :pid (NOT IMPLEMENTED) # name_key :name (NOT IMPLEMENTED) # prop_accessor Fixnum, :pid, :sql => "smallint DEFAULT 1" # has_many Child, :children # many_to_many Role, :roles # sql_index :pid # -# == Design +# === Property Metadata # +# Og defines, reserves and uses the following property +# metadata types: +# +# [+:sql_index+] +# Create an sql index for this property. +# +# [+:unique+] +# This value of the property must be unique. +# +# [+:name_key+] +# This property is used as name-key. +# +# === Design +# # Keep the main classes backend agnostic. -#-- -# Try to make the methods work with oids. Do NOT implement descendants -# use a root id (rid). -#++ +# # For class ids we use the name instead of a hash. Class ids are # typically not used in querys, they are stored for completeness. # If we store a hash we cannot reclaim the class thus invalidating # the point. Instead of .name(), to_s() is used so the methods # are more flexible (they accept class names too!!) @@ -66,12 +78,14 @@ # databases. # # The og.xxx methods are more flexible and allow you to use # multiple databases for example. # -# == Managed Objects Lifecycle Callbacks +# === Managed Objects Lifecycle Callbacks # +# * og_pre_read +# * og_post_read # * og_pre_insert # * og_post_insert # * og_pre_update # * og_post_update # * og_pre_insert_update @@ -79,11 +93,11 @@ # * self.og_pre_delete # # A class level callback is used for delete because typically you call # delete with an oid and not an object to avoid a deserialization. # -# == Future +# === Future # # * Support prepared statements (pgsql) # * Support stored procedures (pgsql) # * Support caching. # * Deserialize to OpenStruct. @@ -95,10 +109,10 @@ Name = 'ObjectGraph' # The version. - Version = '0.11.0' + Version = '0.12.0' # Library path. LibPath = File.dirname(__FILE__)