Class name suggestions?


#1

Ok, I’ve got a class I’d like to release, but am stuck trying to think of a good name for it!

Basically it’s a tree node object, sort of an “XmlElement on steroids”… It contains a set of named properties (these are implemented as ‘var’ objects so they can store numbers natively rather than having to convert them to strings like xml does). Like xml, it can contain any number of sub-nodes. But its killer feature is that every operation you do to the tree (add/remove nodes, change/remove properties) is undoable. It also lets you attach listeners to any node to find out when properties or the tree structure changes. And because it’s similar in structure to XML, it can be converted to/from XML for easy storage in a readable format.

When I was writing the original Jucer the thing that was an absolute PITA was that every time I added any option that changed an item’s properties, I had to write an UndoableAction class to implement it - this took ages and made the code really bloated and unreadable. But using one of these trees, it’d handle all of that for you, and it’d be a breeze to build powerful editors for complex structures.

So it’s a cool class, but what should I call it!? VarTree, SmartNode, VarNode, Node, SmartTree, PowerTree… ? All a bit naff… Ideas please!


#2

PropertyTreeNode ?


#3

Good, but maybe a bit long… I’m not afraid of long class names, but this feels like it should be a bit more concise.


#4

…thinking of words for “things that hold stuff”… like Vessel, Tank, Vat, Container, Cask, Tub, Box, Chest, Trunk…


#5

XmlElementExt
XmlDataPower
XmlStruct
XmlPropertyObj
XmlObjProperty

should be thinking about creating a class for creating zip files
Library Pocohttp://pocoproject.org/
Poco zip class Compresshttp://pocoproject.org/docs/Poco.Zip.Compress.html


#6

Yes… it’s not actually XML, though.


#7

How about DataTree?


#8

Not bad. Or DataNode.

I’m tending towards Tank at the moment - that has a nice ring to it, and sounds powerful!


#9

and I’m pretty sure no one would ever think to Tank when searching for a class that do something like that :slight_smile:


#10

DataNode or PropertyNode sound good to me… PropertyNode is more appropriate if you actually inherit the PropertySet interface.

or DataElement, to recall the fact that is more or less like the XmlElement structure


#11

This sounds like a perfect candidate for an in memory mapping of the JSON format which I find more uniform and self consistent than XML.

as for the name, DataNode or PropertyNode sounds good to me but var or Variant would do as well.


#12

I think it’d be a good idea for it to have methods to load/save it as either JSON/XML/binary. Not sure if it’d be appropriate for loading 3rd party JSON data, as it’s probably not an exact mapping for the JSON grammar.

How about “BagOfHolding”?


#13

DataNode or PropertyNode sounds good, but since it is smart enough to support undo-redo SmartDataNode
SmartPropertyNode
SmartMultipurposeNode
SmartTreeNode
MultipurposeNode
MultipurposeTreeNode
GenericTreeNode
could be worth while.


#14

Pocket or Suitcase are suitable names for me, and they denote some sort of imagination, rather than speaking always programmer’s speak…


#15

ActiveDataNode

ActiveDataElement…


#16

XElement
XNode
XContainer


#17

XTree


#18

I wish I hadn’t asked now! Too many choices is making it harder to decide!


#19

Whatever name you give it will be fine.
I can really use this “XmlElement on steroids” class, sounds very interesting.
Can’t wait!


#20

KillerNode!!!
Or maybe KillerTree
or just Killer!!!