I don't disagree with your comments. My comments were merely to highlight
how Bindable works and how other initialization approaches may need to exist
*and* should be seen as similar in concept--I was not picking on Bindable.
I don't think you need every possible approach directly in pivot.

However, some small changes allow other major approaches! I've only
advocated for making those small changes so that another approach is not too
hard to make happe. I am not advocating that the bigger pattern should be
directly supported by pivot. And these small changes are actually are a step
ahead of say, xaml processing, just as scripting in the serializer is a step
ahead.

The power of pivot is that it has a few options here versus only one
option...that's a good thing.

Thanks for your thoughts.


-----Original Message-----
From: Greg Brown [mailto:gkbr...@mac.com] 
Sent: Sunday, June 20, 2010 12:56 PM
To: dev@pivot.apache.org
Subject: Re: Pivot components & the keyboard

> Bindable only works on the root object of the serializer and does not have
> the proper link to the component to initialize off of it

Generally, the Bindable object will be the component, so it doesn't need a
reference to it (beyond "this").

> pivot also uses the Bindable interface to tag an
> object that is requesting a bind() to be automatically applied to it in
> addition to calling initialize()

They go hand-in-hand. initialize() is called to notify the object that
binding has taken place.

> If you extend the Bindable concept to
> every object and make it so that it does not require source code access to
> make the initialize happen, then that works for me.

The sole purpose of Bindable is to ensure that bind() gets called by
BeanSerializer. initialize() is called to let the bindable object know that
this has taken place. Other objects (that don't have bindings) don't need a
special notification method because they can simply use the constructor for
this.

A big part of the Pivot philosophy is "using the right tool for the job".
Inheritance is a major part of OO design, and Pivot is designed around OO
concepts. So subclassing is a "tool" that you are encouraged to take
advantage of in Pivot development, not avoid. BXML exists solely to make it
easier to construct object hierarchies. We think that XML is a more natural
fit than procedural code for this. However, it is not meant to replace
coding altogether.

Reply via email to