Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to split a web application in different wars as modules?

I have a web application with different features such as map view, dashboard, report etc. But now, we are planning to split the application in different modules such as map module, dashboard module, etc. to make plug-gable as per the requirement. As all the modules will have their respective htmls, js, controllers, dao layers, how can be these divided as independent modules? Will it be a war or a jar files? Need a suggestion or example which can help me move forward.

Thanks.

like image 309
GuruKulki Avatar asked Jul 09 '15 12:07

GuruKulki


2 Answers

If you have different modules, with independent features. Its possible.

I recommend you, to first, find what features are common to all web-modules, so this common-module, should be installed (as a jar for example) in the library folder of your server.

Then, all the modules could be installed in the webapps of your server (in tomcat is called as webapps).

Important:

You must be careful not to duplicate libraries in each web-module, beacause this would generate conflicts. All your common jars (libraries or your own modules should be installed in the libs folder).

If you are using maven I recommend you to have a parent maven project with all your dependencies included, and then all the modules which needs these dependencies can import it as provided.

like image 191
melli-182 Avatar answered Oct 07 '22 08:10

melli-182


Microservices might be your best approach given the requirement you are sharing here. Each module i.e reporting, dashboard etc will be a separate microservice. If you use spring boot, you will end up creating multiple jar files and each jar file can be booted on the VM as a separate process and each one comes with its own container (tomcat). Makes things simple.

like image 1
Praveen Krishnan Avatar answered Oct 07 '22 09:10

Praveen Krishnan