• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using spring to develop java library, needed best practise for configuration?

 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using spring to develop a java library which will be plugged in to our other projects.

So, there is some dependency (even after annotations used) which will go in an XML file.

Now, I can load this xml from inside packaged jar, But it would be different spring context . Ideally,it should be in the same spring context created by application which uses this JAR.

To be in the same spring context,whoever uses this JAR library file needs to include this XML content in their own spring configuration XML file.

It doesn't seem a best practice to include configuration of JAR file in Application.

Any Ideas???
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using something like org.springframework.context.support.ClassPathXmlApplicationContext, the context should be the same.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have a default configuration it's fine (IMO); it can always be overridden by the project using your library.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic