Hello guys,

Firstly I want to thank you for taking time reading my post. Secondly I'll explain my problem...

I've got some DAO's (Data Access Objects) These talk to the database and are soley responsible for transfering data too and from the database.
I've thought for demonstration purposes it would be nice if I could implement some dummy DAO's that load data from a cache.

If i had a common interface and the JVM didnt know what happens in the implementation would it be possible to tell the JVM which classes to load when loading the application?

Eg if I build the dummy I get the dummy version of the DAO's? Or if I used the real implementation I get the real ones?

Hope this make sence

Kind Regards,


I don't know what you are trying to convey here. Maybe posting some example or coming up with a better example would be more like it.

Is it that you want to dynamically load a different class file in different situation? You can trying keeping a command line parameter which would decide which class file to load based on the switch supplied at the command line.