File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Suggest me good design pattern

Nagesh Gummadivalli
Greenhorn

Joined: Oct 27, 2003
Posts: 1
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

Joined: Aug 19, 2005
Posts: 2906
Moving this to the "XML and Related Technologies forum" as you are using the XML Beans API.


"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Suggest me good design pattern
 
Similar Threads
how to connect different datasources using multiple datasource using ENC
Getting SOAP Fault: No adapter for endpoint
Generics
Pattern to hold list of objects attribute name, value and data type
Differences between targetNamespace and default namespace