I have worked on separate web vs stand-alone Spring applications, never both together in one project.
Now a business need has come up that requires to have both the Web (Web Services) related part and the stand-alone application in Spring to reside in the same project (CVS repository as well as Eclipse).
The WS app is a small one and uses may be 30% of the total DAOs, Service classes and other configs in the common code for both apps. I have tested the web app(along with the Web Services) and it works fine with the web.xml configured to call the 'contextLoaderServlet' on startup. I will require a lot of code change for the stand-alone related bean initializations and access if I combine the two projects and will need to write separate bean access and loading code anyways.
Has anyone combined such two projects? What are your suggestions on the approach for this? All suggestions are welcome !! [ November 06, 2008: Message edited by: Shailesh Welankar ]
I would not combine the projects myself either. But if you are forced to, which will be a bad idea, then you will be required to make two different build paths. One that builds your web version, and one that builds your stand alone. Each will need to copy different xml configuration files for Spring. You will need to make sure you really separate your configuration file, so that you can pick up just what you need in the build.
It also sounds like you will also need to put logic into your build so that you only pick up the classes that is needed for each project.
Thanks Mark and Nate for your valuable suggestions.
Yes, I can understand why it would be prudent to implement the two projects separately instead of combining them. Will see how that goes with the "higher-ups". If I have to go with the combined approach, will separate them internally to the project so that building them (I use ANT scripts to generate the WAR and JAR files needed as distros) will be easier and the project will still be under one name.
thanks all for the suggestions !!
subject: Suggestions for Web as well as stand alone Spring application in one project