pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger L. Whitcomb" <Roger.Whitc...@actian.com>
Subject RE: First impressions of a wannabe adopter
Date Tue, 25 Sep 2012 22:18:42 GMT
Hi Greg,

                First of all, thanks for taking the time and initiative
to look at and study Pivot!  I was in your shoes not all that long ago
myself.  So, let me address a couple of your comments from my

* It is definitely possible to write anything you already have in BXML
in pure Java.  BXML is basically a reflection-based convenience
interface that is taking the XML representation and (via reflection)
creating the objects and setting attributes as it encounters them in the
markup.  So, ANYTHING you can do in BXML you can definitely do in pure
Java, because ultimately it IS being done in pure Java under the covers.

* But, having said that, sometimes there are some (fairly) hidden things
that are going on that are not immediately obvious.  One has to do with
the @DefaultProperty annotation on various classes (see Viewport for
instance).  This is used by BXML to decide how the child elements of an
element are to be wired to the parent.  If this property is present on a
class or its superclass, then by default the children will be set using
this property even if the property isn't directly coded in the XML.  For
instance, because of @DefaultProperty, you can write this:


   <TextArea ...>


Instead of having to code this:



    <TextArea ...>



* Another difficulty has to do with the way Menus are hooked up to
Frames.  This is done via the "setMenuBar" method, and thus looks like
this in BXML:





In pure Java, you would create a MenuBar object, and the call
"frame.setMenuBar(menuBarObject)".  This bxml is exactly a shortcut to
this Java sequence.  So, you see the XML elements that begin with lower
case are mapped to bean attributes on the parent object and set that
way, while elements that begin with UpperCase are mapped to actual Pivot
Java objects and instantiated with "class.newInstance(...)".  When new
child objects are encountered and there is a @DefaultProperty on the
parent, then the child/ren are set using that (which also means there
can be only one child object), otherwise the parent is assumed to
implement Sequence<Component> and the children are added via the
"add(component)" method.  If you really want to know more, the source
for BXMLSerializer is a fascinating read.   Did you read the BXML Primer
here http://pivot.apache.org/tutorials/bxml-primer.html (I'm sure you

* I very much agree that there are holes in the examples, documentation,
Javadoc, wiki, etc.  But, I found what is there to be extremely
valuable, and I still use the ComponentExplorer, the Javadoc and even
the tutorials on a regular basis. 

* So, one way that someone new could REALLY help is by filling in that
kind of information, or adding tutorials, responding to the user mailing
list, etc.  I never had a question in my early days with Pivot that
either somebody didn't answer, or that I couldn't figure out by looking
at the source.  And we'd be very happy to accept patches that improve
the new user experience J  And several of us really try to answer every
user inquiry as soon as possible (given that we have full-time jobs and
families too).

* It is VERY possible to write big production applications using Pivot.
We have released the first version of our product using it, with
~150,000 lines of code, and we now have 4 developers who are reasonably
to very proficient.


HTH, and please don't hesitate to ask if you don't understand something
- that's, in big part, how I learned.....



~Roger Whitcomb


From: Greg Brannon [mailto:greg.d.brannon@gmail.com] 
Sent: Tuesday, September 25, 2012 2:36 PM
To: user@pivot.apache.org
Subject: First impressions of a wannabe adopter


Talented Pivot Developers, Users, and Supporters,


I like Apache Pivot, but I want to like it even more. I want to know it.
I want to be able to use every class and method of it, explore it, know
the ins and outs of it; know where it excels, what its limitations are,
and write a challenging project with it. If I don't know how to do
something with Pivot, I want to be able to click on a link or (if I have
to) pick up a reference that has the info I need to figure it out. But
at the moment, my experience with Pivot has not left me with confidence
that I can know Pivot well enough to be successful using it.


Believe me, I've tried. I worked through every tutorial, writing minor
variations for each, moving code around, using different components,
exploring the various ways to write action handlers. I used the
Component Explorer, wondering, "Why aren't the major containers, like
Window, Frame, Sheet, etc. included?" I've studied the API, learning the
details I could for most every element of the Framework I've used
throughout the tutorial experience.


Then I struck out on my own. I wrote some basic interfaces in bxml,
toying with ideas I have for a project I'd like to write in Pivot. Those
went well, they looked okay, I've learned to like the bxml interface
design approach - in fact, I don't want to give it up - but there were
nagging questions I couldn't answer. "Be patient," I told myself. "Keep
plodding along, and the details will come."


Then I gave myself an assignment I thought might answer some of the
nagging questions: Take an interface I'd already designed in bxml and
rewrite it completely in Java. The interface included a Frame with a
MenuBar, 2 MenuBar.Items, each with a Menu with 2 Menu.Items, Border,
TablePane with columns and rows, BoxPane, and a couple Expanders. No
function, just the shell of an interface.


I couldn't do it. I tackled the task, incrementally writing each part in
the same order as listed above but got stuck early on at the MenuBar and
Menus. I could not find the information I needed to accomplish what
should be a relatively (I thought) simple thing.


I could accept that maybe it was a stupid idea. Why write an interface
completely in Java that can be defined easily in bxml? I don't know. Why
not? Shouldn't I be able to? Or if it's not possible, shouldn't that be
documented somewhere? I could have accepted it if I thought it were
true, but I don't. So I walked away from Pivot, thinking what I wrote in
the first paragraph.


So that I don't come across as just a complainer, I'm volunteering. I'm
still excited about Pivot's potential, I believe in it and am impressed
by Apache's projects overall, and I'll help in any way I can to improve
Pivot's packaging to enable it to be more widely adopted. But I
shouldn't bound or limit my offer to help. I'll simply do whatever I can
to help, period. Just let me know what I can do.


Until Pivot's documentation or usability improves, I'll work on my
project using plain ol' Swing.


Greg Brannon

Hughesville, MD USA

(443) 684-2064

View raw message