April 9, 2007

Struts For Swing

Filed under: Java — khangharoth @ 7:37 am

In my first job ,we were using Struts for the front end architecture and life was very easy as binding between model and Presentation layer (Jsp ) was automatically handled by Struts.

Right now i am working on a big desktop application which has Gui on Swing,and again the problem of Data binding of model with View came up.The idea of manually coding event listeners and copying from one layer to another itself was depressing.

So i started searching some framework for Swing which can do what struts does for web.

To my surprise their was none which was mature at that time but know it seems their is lot of effort going this way.

To name a few

  • Swing Application Framework : This has more than binding and in future can become de-facto way of creating Swing Applications .Watch this out as this is Sun in house effort and hence it will be very well integrated with rest of Java world.
  • JGoodies : Quite mature framework and can solve various Swing needs from Look and Feel ,Layout ,Validation ,Binding etc.Lot of people are using this for commercial application so tested in production environment.For time being till Sun comes out with proper Swing Application framework ,this should be your choice.
  • TikeSwing : An open source effort for data binding and while evaluation i was really thrilled with its design and capability.Only problem is their aren’t many application developed on it ,and hence its scalability in production environment is in doubt.Its not that i stumbled upon any limitation ,its just that their isn’t much developer base behind this.

Well time is ripe for Java Desktop applications and now its seems Sun has also starting to move in this direction rather aggressively.So in coming years writing a Swing based application will be easy and faster even for new developers.


April 6, 2007

Comment your Code

Filed under: Software Design — khangharoth @ 1:21 pm

After three years of Software experience now i am finally able to understand the importance of commenting the code.

And its not for other guys ,its for you also.That more complex is the piece of code in terms of businesses requirements harder it will be for you to understand after say 6 months.

Also while commenting emphasis should not be much on technical details as but more on business requirement.While coding initially you thought some common solution will solve this problem but after getting all the requirements you realized that this is a special case and hence need some weird logic.Document it ,because chances are the everybody else and you also (after 4 months ) will again think why can’t this be done in a simpler way.

I sometime back read somewhere on net

Good programmers comment their code.

Great programmers comment on why they choose a particular implementation.

Master programmers comment on why they didn’t choose other implementations.

This can be a good philosophy for commenting your good.

Blog at