« Unit testing privates, and other unsavoury topics | Main | Recognition gap »

Don't Overcomplicate Things

A gentle reminder to myself: don't make things more complicated than they need to be.

I'm in the process of creating a JSP tag to render a dynamic tree list, similar in intent to the JTree in Swing, but for JSPs. For one reason or another, I can't seem to find one out there that already exists that does what I want.

In any case, having got a mocked-up HTML page with all the Javascript working, I need to turn it into a JSP. One part of what I'm going to need is data to construct the tree dynamically from. So, thinking of JTree, I start creating a TreeModel-like interface.

Then it hits me: all I want from the tree is a display value and a real value, and to be able to look up the display value from the real value. In other words, all I need is a Map. If the user (me) cares about order (yes), they can use a SortedMap or a LinkedHashMap.

This will save me a bucket of time later, especially because the data I will derive the tree list from is already a Map.

Simplicity really does help.

Post a comment


About

This page contains a single entry from the blog posted on August 19, 2004 10:30 PM.

The previous post in this blog was Unit testing privates, and other unsavoury topics.

The next post in this blog is Recognition gap.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.35