This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Factory + ClassLoader Question

 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys -
Given: A set of class objects returned by fctory methods, e.g. Factory.getInstance().
Requirement: Dynamic loading of these classes.
Statement: In all cases, this requires a custom ClassLoader.
Is the 'Statement' correct?
Regards, Guy
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you're saying. Given a "set of class objects"? What are these, and how do they relate to the classes you want to load? Are these instances of the class Class? Instances of some other class, like maybe the one you want to load? In either of the above cases, it would seem you need to load the desired class before you can have any instances of that class, or of Class objects which represent your desired class. So I'm probably missing something here. Perhaps you could show a bit more of an example of what you're talking about?
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are trying to implement dynamic re-loading of classes, then you will need a custom ClassLoader.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, yes. Agreed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic