After two days, I finally finished the implementation of taxonomy importer. My task is to import a taxonomy in XML format to an internal tree structure. Each taxonomy term will be a tree node. The AIS API then can call on the terms for further operation.

I pick JDOM as the XML parser. It seems simple to use. And have been proven by many developers. Even Horst has used it in AIS API.

I spent some time thinking whether I shall rely on JDOM to perform tree operation each time I need to retrieve the taxonomy nodes as JDom internally parses the whole XML document into a tree structure. However, it is not a clean design. What if I need to perform more than one operation on this tree structure? And the DOM tree built by  JDom has many nodes which are unnecessary for my use.

I planned to finish it in a day. But got the design wrong: I thought the tree structure is always binary. In fact, one node could have multiple children. Also, the concept of forest can be implemented as a array of tree structure. Nothing special.

I worked from home this Wednesday, spend my work hours in Barnes and Noble nearby my home. Darn it the wireless network by AT&T is not free. But luckily my notebook detect a “unsecured network”, it’s slow, but free.

The 2nd day at work (Thursday) I realized I should have designed it to allow multiple children. But at least I got it right on Wed the visitor pattern shall be used.  ;-)

I demo it to Christof. He suggested me document the code. And think what should be the next step.