java - Maven + Spring architecture for jboss -
i'm creating maven modules of spring + jersey+ mybatis application in jboss server. have following structure
app-parent | \ | \_ app-module1 |____ app-module2 |____ app-module3 |____ app-lib each of app-module* has dependency of app-lib, , each of app-module* not refer other app-module*. daos, services etc., should contained within itself, except app-lib(utilities, logging etc.,).
note: jboss datasource has jndi name app.module.ds.
-> question is, best way configure spring datasource bean type of application?
- can 'datasource' bean created per app-module*?
- or should create 'datasource' bean in common library 'app-lib' , share among applications?
which 1 better? , why?
as always, depends on needs.
- micro-services way
if each component separated application , although going work not mixed, in micro-services fashion, better have separated datasource configurations.
- taking care of transactions , other cross-cutting concerns
if modules going work , mixed 1 big main application, want configure transactions, aop service, logging, security, etc. in 1 single place. think need put of these beans in single place app-lib module, or better, in new module handle these kind of configurations. easy read article about cross-cutting concerns.
...
Comments
Post a Comment