| Universal Editor | ||
| One for all... all for one | ||
I grew up learning Java on TextPad. For some reason, I always
felt that IDEs cripple you by making your life too easy. Also there was this fear of getting
too vendor specific and feeling lost if the crutches are pulled out. I hated Visual Age for Java.
My philosophy was working good till the time I got introduced to J2EE. My ambition
to remain IDE neutral was shattered when I realized that most of the application servers
were tightly coupled with the IDEs, just because the application server had it's proprietary
XML configuration requirement. I hated using vendor specific IDE just because of a
simple XML (Heard of WebSphere AAT??) !! I wanted an XML editor in which I could load the
DTD and the tool would guide me create an XML out of it.
There was XMLSpy, but it was too expensive for me. I tried IBM's Xeena but it was too boisterous. There was such a dearth of cheap (free) and light XML editors. Finally, I thought of building my own! It wasn't too difficult and at the end I had a 150KB editor in which you could load any DTD and chug along. Computationally the excercise involved broadly the following items:
a)A mechanism to parse the DTD and make a parse tree out of it Data by it's very nature is structured. The structure can be very comfortably expressed in a tree structure and DTD can be effectively used to constrain the structure of the tree. Now, the data tree can be transformed by one or more formatters and can be consumed by one or more consumers. A XML formatter and a File persister are just one of the producers and consumers. This thought makes the UI very generic, in fact so generic that it can be used as UI dialogs in many applications. For example, let's say I want to create a search dialog to capture data relating to the search query. I can express my data requirements as:
With this, I can ask the UI to use the above DTD to capture the search data and
once done, call back a pre configured object with the data tree. After the callback
it's the application's responsibility to make use of the data.
Ok, I think you get the line of thought. You can download the source and binary for playing around.
|
||
| ©2007 Sandeep Deb
All Rights Reserved. Best viewed with Internet Explorer and a screen resolution of 1024 X 768 |
||