Name
Object::Relation - Advanced Object Relational Mapper
Synopsis
package MyApp::Thingy;
use Object::Relation;
meta 'thingy';
has 'provenence';
build;
Description
Object::Relation is an advanced object relational mapper. Use it to define your model classes and it handles the rest. And by that I mean that it works hard to exploit the most advance features of your data store to provide efficient yet easy to use objects for use in your system. It currently supports SQLite and PostgreSQL data stores.
Notes: Develoment and documentation are still in progress; this should be considered an alpha release. Do not use it in production as things will likely change over the next few months. But don't let that stop you from playing with it now to see what it can do!
And now back to the documenation that still needs updating.
Basic Usage
This package makes it dead simple to create Object::Relation classes. It overrides the funcions in Class::Meta::Express so that the class is always built by Object::Relation::Meta and so that attributes are strings by default. Of course, these settings can be overridden by explicitly passing the meta_class
and and default_type
parameters to meta()
:
package MyApp::SomethingElse;
use Object::Relation;
meta else => (
meta_class => 'My::Meta,
default_type => 'binary',
);
Or, for attribute types, you can set them on a case-by-case basis by passing the type
parameter to has()
:
has image => ( type => 'binary' );
Interface
The functions exported by this module are:
- meta
-
Creates the Object::Relation::Meta object used to construct the class.
- ctor
-
Creates a constructor for the class. Note that all classes created by Object::Relation::Meta automatically inherit from Object::Relation::Base, and therefore already have a
new()
constructor, among other methods. - has
-
Creates an attribute of the class.
- method
-
Creates a method of the class.
- build
-
Builds the class and removes the above functions from its namespace.
To Do
Add caching to the store.
Use batch updates and inserts for collections?
Move all types into classes.
Make teardowns reverse setups instead of just wiping out the database.
Swith from XML::Simple to SAX in Format::XML.
See Also
- Object::Relation::Meta
-
Subclass of Class::Meta that defines Object::Relation classes created with Object::Relation.
- Class::Meta::Express
-
The module that Object::Relation overrides, and from which it inherits its interface. See its documentation for a more complete explication of the exported functions and their parameters.
- Object::Relation::Base
-
The base class from which all classes created by Object::Relation inherit.
Bugs
Please send bug reports to <bug-fsa-rules@rt.cpan.org>.
Author
Kineticode, Inc. <info@obj_relode.com>.
Copyright and License
Copyright (c) 2004-2006 Kineticode, Inc. <info@obj_relode.com>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.