Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Suggestions for Web as well as stand alone Spring application in one project

 
Shailesh Welankar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,

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 ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't combine the projects, I'd pull the common parts out into a common project and have the web service and the stand alone app depend on the common project.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

It really isn't a good way to go about this.

Good Luck.

Mark
 
Shailesh Welankar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic