[Nitro] Serious discussion on Annotaitons - Part II

transfire at gmail.com transfire at gmail.com
Thu Nov 2 13:30:56 EST 2006

Jonas Pfenniger wrote:
> Perhaps the real problem is that Annotation is just too generic. You
> can 't keep it simple and have all the features. Especially the
> inheritance. So what are the boundaries of the annotation system ?
> * inheritance ?
> * type-casting system ?
> * central storage ?
> * default settings ?
> * description ?
> What do you envision it beeing used for ?

Perhaps you are suggesting that the annotations system not be a single
univeral interface?  Martin Fowler is thinking along these lines at
http://martinfowler.com/bliki/RubyAnnotations.html. So rather then say:

  ann :x, :doc => "This is helpful", :class => Integer, :default => 0

One would have:

  doc :x, "This is helpful"
  default :x, 0
  classify :x, Integer

I've brought this up before, and it's actually not incompatible if done
a little bit differently:

  ann :x do
    doc "This is helpful"

In anycase, by making the annotation a class method one does have more
control over what that annotation does via the standard Ruby
metaprogramming techinuqes. On the downside there the potential for
contention in the class-level namespace.


More information about the Nitro-general mailing list