File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 2932
Moving this to the "XML and Related Technologies forum" as you are using the XML Beans API.
I agree. Here's the link:
subject: Suggest me good design pattern
It's not a secret anymore!