Plan: ActiveData
February 22, 2006 § Leave a comment
a plan of action. [Read more] for the details,
and stay tuned for the implementation.
ActiveSalesforce as a possible starting
point]
Just to summarize, the best plan
appears to be:
a) Create a plugin
(“activedata”)
http://wiki.rubyonrails.org/rails/pages/HowTosPlugins
b)
Define my own module containing my custom classes
(“ActiveData”)
c) Define a new generic
Query object, and test it for backward-compatibility
(“ActiveData::Query”)
d) Define
subclasses for methods I want to override,
e.g.,
* ActiveData::Base <<
ActiveRecord::Base, for generic
queries/updates
* ActiveData::Adapter
<< ActiveRecord::ConnectionAdapters::AbstractAdapter, to vend Query
object
e) Implement the CoreData
adaptor and query, as a separate subclass
(module?)
f) Write unit tests
validating all the above
And if this
all works, then we can discuss whether it makes sense to refactor parts of ActiveRecord (perhaps for
Rails 2.0) — but right now that would be
premature.
From Nathaniel
Brown:
Emil Marceta, a local
Ruby guy here in Vancouver wrote this post to the vanruby.com mailing
list.
http://lists.vanruby.com/pipermail/discuss/2006-January/000050.html
It
describes how to use ActiveRecord’s validations against table-less data model
based on Rick Olson’s code here:
http://rails.techno-weenie.net/tip/2005/11/19/validate_your_forms_with_a_table_less_model
Leave a Reply