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?

  1. can 'datasource' bean created per app-module*?
  2. or should create 'datasource' bean in common library 'app-lib' , share among applications?

which 1 better? , why?

as always, depends on needs.

  1. micro-services way

if each component separated application , although going work not mixed, in micro-services fashion, better have separated datasource configurations.

  1. 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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -