wood burning stoves 2.0
The moose likes XML and Related Technologies and the fly likes Suggest me good design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Suggest me good design pattern" Watch "Suggest me good design pattern" New topic

Suggest me good design pattern

Nagesh Gummadivalli

Joined: Oct 27, 2003
Posts: 1
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">
AdapterManager name="OracleAdapterManager" type="java" namespace="com.adapters.OracleAdapterManager">

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

Joined: Aug 19, 2005
Posts: 2922
Moving this to the "XML and Related Technologies forum" as you are using the XML Beans API.
It is sorta covered in the JavaRanch Style Guide.
subject: Suggest me good design pattern