AppFuse Refactorings Part I: Changing directory structure
I changed the directory structure of AppFuse's "src" and "test" directories this weekend. Rather than:
src - common - ejb - web
I changed it to:
src - dao - service - web
The change wasn't too difficult, but the results of doing it make me a bit sick to my stomach. I always new that the Managers in AppFuse were dependent on Struts, that's why I originally put them in the src/web/**/webapp/service folder. Now that I've moved them into the service folder, they don't inherit all the luxuries like struts.jar being in the classpath. Even worse, to compile the Managers, I have to compile any ActionForms, both from the build/web/gen directory, as well as from src/web/**/Form. This is because the Managers use BeanUtils.copyProperties() to transfer values from POJOs -> ActionForms and visa-versa.
Ech - this exercise has really shown me how tied together the different directories and layers are. I think I
liked it better the other way - or maybe I just liked not knowing how tightly integrated everything was. ;-) The most frustrating thing turned out to be that Ant's <javac> task wanted to re-compile the generated ActionForm's each time I I ran "ant compile-service". Adding an <uptodate> property fixed this problem, but it seems like it should be easier than that.
I ended up putting the org.appfuse.model
package in the "dao" directory. It just made things easier - since the model.* classes are used in my DAOs
and the "test-dao" needs the XDoclet-generating Hibernate mapping files. I didn't want to have to depend on classes in the src/service directory to compile src/dao. It's bad enough I have to do that with the service-web stuff.
All in all, I'm happy with the refactorings, but implementing workarounds for the service-web relationship was no
fun. I probably did this when I originally created AppFuse, but since I haven't heavily manipulated build.xml in so long - I've forgotten the trouble I went through.
Oh yeah, I also integrated Spring for binding the layers and configuring Hibernate. And Charles' persistent cookie strategy? That's done too. I'll write up details on both of these refactorings in the next couple of days.
Posted by Jaap on February 04, 2004 at 06:45 AM MST #
Posted by Otis on February 04, 2004 at 01:29 PM MST #
Posted by Matt Raible on February 04, 2004 at 05:28 PM MST #
Posted by Bear Giles on February 04, 2004 at 07:21 PM MST #
Posted by Bo on February 04, 2004 at 08:41 PM MST #
Posted by tiger on February 07, 2004 at 03:50 AM MST #
Posted by susan elder on March 29, 2006 at 11:14 PM MST #
Posted by 66.194.182.7 on April 15, 2009 at 07:19 PM MDT #
Posted by 66.194.182.7 on April 15, 2009 at 07:20 PM MDT #
Posted by 66.194.182.7 on April 15, 2009 at 07:20 PM MDT #