Activity

When Andres first voiced his disapproval of the switch statements, I converted a couple of the worst offenders and profiled. It basically comes down to a slight gain in performance (separate instances) vs a slight savings in memory overhead (one instance with switch). The differences were minimal, so I didn't bother converting the rest of the factories.

Given that, it's mostly a code style issue. If you feel strongly enough about it that you want to refactor the rest of the factories, I say go for it!

Dean Iverson
added a comment - 29/Jan/12 11:40 AM - edited When Andres first voiced his disapproval of the switch statements, I converted a couple of the worst offenders and profiled. It basically comes down to a slight gain in performance (separate instances) vs a slight savings in memory overhead (one instance with switch). The differences were minimal, so I didn't bother converting the rest of the factories.
Given that, it's mostly a code style issue. If you feel strongly enough about it that you want to refactor the rest of the factories, I say go for it!

Though performance wise there doesn't seem to be so much gain, when reading the code the history is different. Also, providing a hierarchy of factories can help in registering 3rd part components (like those created by the awesome @hansolo_). So, limiting ShapeFactory (for example) to those nodes provided only by javaFX SDK is not a good idea Same principle applies to all other switching factories.

One last point. If an agreement is reached regarding builder metadata it's very likely that the groovyfx factories will need to be refactored to follow the same model as the rest of FBS based builders.

Andres Almiray
added a comment - 29/Jan/12 12:00 PM Though performance wise there doesn't seem to be so much gain, when reading the code the history is different. Also, providing a hierarchy of factories can help in registering 3rd part components (like those created by the awesome @hansolo_). So, limiting ShapeFactory (for example) to those nodes provided only by javaFX SDK is not a good idea Same principle applies to all other switching factories.
One last point. If an agreement is reached regarding builder metadata it's very likely that the groovyfx factories will need to be refactored to follow the same model as the rest of FBS based builders.
My $0.02