[Nitro] TRANS: Facets annotation problems
transfire at gmail.com
Tue Sep 19 11:40:30 EDT 2006
On 9/19/06, Jonathan Buch <john at oxyliquit.de> wrote:
> today was a nice day and so manveru though about migrating Og to
> facets 1.7.x.... Big mistake, annotations are a huge pile of...
> I dunno what to say.
Ummm... have you considered how such words might make me feel? Maybe
you should try writing it yourself to get some perspective.
> A few questions from manveru:
> something.ann.self[:foo] vs something.ann.foo vs something.ann[:foo]
The last two mean the same thing,
The first one is something completely different. In
something.ann.self, self is a reference to the annotation specific to
the object 'something'. There's still issues with the self key (for
instance I just noticed you have to do something.ann[:self] first for
it to work) and I'll of course wor on that. In anycase, self in the
context of ann is a special key refering to the object being annotated
(which is usually a class).
> why ! and ? is dropped in new facets (and what did those do anyway)
? was a convenience thing. You would get the same result with or
without it, with one exception: it would return nil instead of null,
and that exception was only there b/c there's no way to tell Ruby to
treat null as a "false" value. But also null was only really needed
b/c the annotations allowed run on clauses, i.e.
If anyone of those elements in the chain was not defined, null was
needed in place of nil to prevent an error from being thrown. But the
new version of annotations doesn't support this (this was specifically
talked about in this mailing list a while a go). Only one depth level
is allowed, eg.
So null is no longer needed here and thus niether is '?' (although I
can add it back in if you just want the option of using a '?' even
though it means exactly the same without it).
The ! is little more ticky. Annotations are inherited so class B < A,
will show all the annotations of class A. But these are dyanmically
inherited, so if you change A's annotations at a latter time, B's will
change too. But if you use ! you can cause an annotation of A to be
*duplicated* for B such that A's will no longer shows through. It's
kind of like redefining a method in a subclass. The ! is still used
though, so I'm wondering how it seems to be missing?
> It would be nice if you could help in outlining how a transition
> of 1.4.5 to 1.7.x is possible, where possible gotchas wait. We'd
> be _very_ happy if you could take a look into Og code yourself
> and see how annotations are used there. If you need directions
> browsing the code, manv and I will be happy to help out.
Okay, well, I can do that if need be. But I think it is important for
other people to know how the Facets elements of Nitro work too. I
don't think it's good that I'm the only one.
/ / transfire at gmail.com
More information about the Nitro-general