[Nitro] injecting Og functionality

Judson Lester nyarly at gmail.com
Wed Mar 14 13:51:54 EDT 2007


The trouble is that all model objects then have to descend directly
from Og::Model.  What if I want to have an ancestor that isn't
persisted?  Whether or not I can think of a use case off the top of my
head, I'd be loath to make that kind of severe requirement to using
Og.

As a for instance, though, I know that I'm hesitant to use Og because
of the Facets requirement.  I probably wouldn't if it hobbled my class
structure design.

On the other hand, it might be advisable to look at putting all the
onus of model-izing a class onto Og::ModelMixin.  Nothing says that we
couldn't use a callback hook to also extend with
Og::Validation::Mixin, or whatever.

Judson

On 3/14/07, Antoniolo <antoniolo at gmail.com> wrote:
> I think model needs to be refactored as soon as possible.
>
> The current way to insert an Og functionally in a regular object is
> including the module ModelMixin, extending Og::Model or using
> attr_accessor/property, right?
>
> imho, the problems begins there.
>
<snipped>
> I can leisurely guess the initial idea of Og is to place the functionality
> in models seamlessly. I mean without any explicit inheritance mechanism. But
> I think it's not too ulgy to use it in application-side:
>
> class Person < Og::Model
> end


-- 
Q: How does a hacker escape handcuffs?
A: Backslashes.


More information about the Nitro-general mailing list