Loving Java all over again
This past week has been hectic. I'be been pumping out what seemed to be a relatively small and simple application for a client. What was a simple 3-table 3-page application is now 14 tables and even more pages. But it's going awesome. It's the most productive I've ever been on a project - thanks to AppFuse, which is further backed up by the powerful Ant, XDoclet, JUnit, Struts and Hibernate.
The reason I've fell in love with Java all over again is I've re-discovered the power of reflection and inheritance. 8 of the 14 tables are child tables of a main "project table." As I noticed I was doing a lot of copy/paste in my DAOs, Services and Actions - I decided to reflection for all these child tables and now I have 3 methods on my DAOs (get/save/deleteProjectChild). Same goes for my Services and my Actions all share the same delete/edit/save methods in a BaseAction.
The only reason I even have child Actions is for URL beauty and to xdoclet-generate the action-mappings. Backed up by tons of JUnit, StrutsTestCase and WebTest test cases - it's been a breeze to refactor and enhance. I'm in love all over again.
Posted by gurunath on October 08, 2003 at 09:26 AM MDT #