Here is another thing to consider. We have always considered Pivot to be, to some extent, what we think Sun should have done instead of JavaFX. In other words, if Sun was to create Swing right now, starting from scratch - what might it look like? We imagine that it might look a bit (or maybe a lot) like Pivot.

We applied the same mentality to our collections. If Sun was to create the JDK collections right now, and do so in conjunction with a new user interface toolkit, what might they look like? Again, I think they might end up looking a lot like Pivot collections.

We have tried very hard in Pivot to only re-invent things that are truly in need of re-inventing. While the JDK collections may not fall into that category on their own, when viewed from the perspective of someone who wants to use them as model classes, they do. They are simply not suitable for that purpose.

So, rather than saddle ourselves with the limitations of the existing classes, we chose to start with a clean slate (as we did with our UI classes). I personally think the result is far more positive than negative.


On Aug 25, 2009, at 12:06 PM, Todd Volkert wrote:

Please review the FAQ for the reasons behind Pivot's collection
implementations.

http://cwiki.apache.org/PIVOT/frequently-asked-questions-faq.html


Yes, I've read them. None of them justify doing this to yourselves or your
users.  There are much better ways to accomplish your goals.


I re-read the FAQ just now, and I think I have more to add that might make
you look at the pivot collections in a new light.

A windowing toolkit such as ours is designed using the MVC paradigm, and there's a need fora set of classes to act as the model. In Swing's case,
they created BoundedRangeModel, ButtonModel, ComboBoxModel, ListModel,
ListSelectionModel, MutableComboBoxModel, SingleSelectionModel,
SpinnerModel, ToggleButtonModel, etc. What we did was to create a small set
of unified classes that can not only serve as the model for all our
components, but also act as generic interfaces for indexed or keyed data. The ubiquitous use of these classes is part of what makes Pivot not only
efficient, but very easy to use once you grok the design.

Now, once you've created these classes, do you put them in
org.apache.pivot.wtk?  No.  They're also of use outside the windowing
toolkit.  Call them collection classes, data classes, model classes,
whatever, but there was a need for which they were created, they satisfy that need very elegantly, and at the end of the day, they're of general use
just as lego blocks are, so they live in the core module.

-T

Reply via email to