[Nitro] new work on annotations

transfire at gmail.com transfire at gmail.com
Tue Jan 23 09:23:29 EST 2007

Started working on annotations again today.

George, I took a look at what your doing in ntiro as you requested. For
the most part I have you convered. There are however two things
outstanding at the moment:

1) The "force" methods (btw "coerce" would describe this better). I'm
not sure yet, are they generic enough or too nitro specific? And how do
they get used exactly? I'll have to think about this some more, so any
more information about them will of course help.

2) This hunk of code is Nitro specific:

        if klass && !serializable_attributes.empty?
          include Og::EntityMixin unless
          include Glue::Validation unless
          include Aspects unless ancestors.include?(Aspects)

So it can't go in the generic rendition of #attr_xxx. Nitro could wrap
the Facet methods of course, but a better way might be via the
callback, which I added, #iincluded_as_property. (I don't like the name
though b/c of "property" better one?). Some where in Nitro:

  class Class
    def included_as_property(klass, attrs)
       unless klass.serializable_attributes.empty?
          include Og::EntityMixin unless
          include Glue::Validation unless
          include Aspects unless klass.ancestors.include?(Aspects)

Others just need to make sure they call super if they override the
callback in their own class.


More information about the Nitro-general mailing list