Cloudfork ActiveItem : ActiveRecord for Amazon SimpleDB
SimpleDB is an Amazon Web Service that provides a “database” in the Cloud. Basic concepts are domains, items and attributes. Domains are named containers of items which themselves have attributes. Attributes have a name and one or more values.
ActiveRecord is a Design Pattern described by Martin Flower. Several implementations exists for different programming languages. The Rails framework includes a very popular Ruby implementation. Basically, every record is represented by on ActiveRecord subclass instance. By using “convention over configuration”, this active record requires little or no mapping for reading from and writing objects to a relational database. It reflects on schema information available from the database ; every change is directly visible to the active record.
ActiveItem is a framework that uses the concepts of ActiveRecord and method signatures from its Rails implementation to provide a persistency layer on top of Amazon SimpleDB. Its aim is to provide simple mechanism for persisting objects using the same conventions. SimpleDB is a schema-less container of items, each of them having attributes that are Strings only. Therefore ActiveItem requires a per class description in which you specify what variables and types need to be stored.
For mapping typed instance variables to attributes, a simple converter interface is available. More advanced features are Sharding (strategy to decide which object goes in which domain), paging access to query results, Smalltalk block-to-select-where expression translation and more complex attribute specifications.
Until Cloudfork AWS is ported to other Smalltalk dialects, this framework is only available for Squeak and can be downloaded from SqueakSource.
The next blog post about ActiveItem will show the basics for getting started with the framework by showing some example code needed to store a ShoppingCart in Amazon SimpleDB:
| cart | cart := ShoppingCart new. cart created: TimeStamp now. cart customerName: 'Lisa'. cart save.
Tags: activeitem, activerecord, simpledb
You can comment below, or link to this permanent URL from your own site.