Koders Search - search codes here!

Monday, February 26, 2007

Experimenting with Apache Struts 2

Spent my Sunday fiddling with Apache Struts 2.0.6. I chose to experiment with the distribution targeted for JDK 1.4.2. After going through the samples i must say that migrating our applications from Struts 1.X will take a big effort and lots and lots of patience because we have to rewrite almost 50% of the codes, save the DAOs and Business Delegate classes. It's tempting to have the dependency injection feature in our apps plus other features like Ajax tags, but i always remember the mantra: if the software ain't broke don't fix it. Rewriting the apps might reintroduce the bugs we squashed.
Anyway Struts 2 impressed me. The combined forces of WebWork and Struts indeed gives fruitfull result. To me the best feature in the framework is the ability to intercept your code via interceptor class. Now AOP became a clearer concept for a 3 year Java developer like me. Altering one's perception of the world does take a practical example to make him/her see..in my case theories alone doesn't work...i need practical examples.
Since Struts 2.0.6 is still in GA (General Available) release i'll assume there will be more things to come(especially the plugins) and the framework will get better and better.Till then i'll depend on our current struts 1.2.x.
which has been our team's de facto standard for web based enterprise applications.

Thursday, February 22, 2007

m:n table mapping is the way to go

New System Requirement Scenario:

Allow Account Manager(AM) to monitor distributors and dealers sales performance. Distributors shall be assigned specific dealers. These distributors and dealers will be assigned to the AM.

Existing System Scenario:

  1. No AM role yet.
  2. No relationship between distributor and dealer.
Been thinking of using a classic solution= m:n table mapping. I will have a table called distributor_dealer which has these fields:
  1. distributor ID (Primary Key)
  2. dealer ID (Primary Key)
  3. Account Manager User ID
will code the classes tommorow and test the relationships.