DESCRIPTION

Want to manage the backend to some other NoSQL database? Then you'll want to consume this role and implement the needed functions. Generally, the store functions should take data structures that conform the Types listed in "document_constraint"/"transform_constraint" and the fetch methods should return those as well.

document_id_key/transform_id_key/reference_id_key are provided to bring more configurability into the equation when fetching documents and transforms. Backends are free to ignore these attributes or provide defaults for them. Generally, the backends should use these attributes.

Transforms and documents should be linked either through the NoSQL database supported references or soft references that require a second lookup. Either way, fetch_document_from_transform can either simply access the referenced document or fetch it from a second lookup, it doesn't really matter. fetch_transform_from_document is only provided for completeness sake, but isn't actually used in the implementation. Two-way resolution of references might not fit your document schema, so an empty subroutine can be safely provided. I reserve the right to make this two-way communication required in the future.

store_document

has_document

This method must accept a key and return a Bool on if the document exists in the store.

has_transform

This method must accept a key and return a Bool on if the transform exists in the store.

is_same_document

This method must accept two Document arguments, compare them, and must return Bool if they are the same

is_same_transform

This method must accept two Transform arguments, compare them, and must return Bool if they are the same

document_constraint

In order for Document::Transform to properly constraint imports on the front-end, it needs a constraint to check against. This method or attribute must return a Moose::Meta::TypeConstraint object that constrains those methods that accept documents as arguments.

transform_constraint

In order for Document::Transform to properly constraint imports on the front-end, it needs a constraint to check against. This method or attribute must return a Moose::Meta::TypeConstraint object that constrains those methods that accept transforms as arguments.

PUBLIC_ATTRIBUTES

document_id_key

is: ro, isa: Str

This holds the attribute key that should be used when attempting to fetch the document.

transform_id_key

is: ro, isa: Str

This holds the attribute key that should be used when attempting to fetch the transform.

reference_id_key

is: ro, isa: Str

This holds the key that should be used when attempting to fetch a referenced document from a transform.

AUTHOR

Nicholas R. Perez <nperez@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Infinity Interactive.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Module Install Instructions

To install Document::Transform::Role::Backend, simply copy and paste either of the commands in to your terminal