Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Suggest me good design pattern  RSS feed

 
Nagesh Gummadivalli
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a configuration file which stores all the implementation class names. Snippet of xml if like below.

AccountManager name="AccountManager" type="java" namespace="com.managers.AccountManager">
AccountComponent name="AccountComponent" type="java" namespace="com.managers.AccountComponent">
/AccountComponent>
AdapterManager name="OracleAdapterManager" type="java" namespace="com.adapters.OracleAdapterManager">
/AdapterManager>
/AccountManager>


I am using xml beans so generated jar files using xml beans compiler.
Now, My question is, I need to write a generic method which instantiates the class by taking input by name( like instantiating com.adapters.OracleAdapterManager" when we pass OracleAdapterManager).
I am struggling to write generic code using XMLBeans API.
Any pointers?
[ September 25, 2006: Message edited by: Nagesh Gummadivalli ]
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the "XML and Related Technologies forum" as you are using the XML Beans API.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!