From: Trans Date: 2007-09-13T02:11:57+09:00 Subject: Re: openobject-0.0.1 On Sep 9, 12:52 pm, "ara.t.howard" wrote: > On Sep 9, 2007, at 1:38 PM, Logan Capaldo wrote: > > > Merge the two projects! ;) > > they are actually quite a bit different - otherwise not a bad idea. > in particular mine is geared toward open behaviour (methods) not only > properties. still - might be possible... I don't see a great deal of difference between Ara's openobject and just using his attribute library with OpenStruct (perhaps with an extra extension or two). OTOH, Facets' OpenObject class is designed to be better than OpenStruct in some ways. It's faster, more open, and doesn't have issues with #dup and so forth b/c of the use of singleton methods. On the surface however, the main item of difference is really the #attribute method. Certainly Facets could incorporate that functionality, but it sort of goes against the grain of it's annotations system, which allows any piece of information to be attached to attributes, not just default values. For example, Ara's lib does: attribute :x => 10 Where Facets' would do: attr_accessor :x, :default => 10 At the moment Facets' annotations library doesn't do anything with the annotations. So this is just a syntax distinction, not a functional one. But I've always planned to expand the annotations system to handle this, and a few other features like casting. It is for this reason alone that I have never incorporated Ara's, otherwise excellent attribute language. Eventually I will get the annotations system handling it. The trick has been finding a good way to generalize the procedure so others can easily add there own "functional significance" to annotations. The key to this may lie in around advice, actually. We shall see. T.