This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Using jdk 1.1.8, is there a way to find all the implementing classes of a specified interface? Really what I'm after is to call a method defined in the interface for all the implementing classes. Thanks in advance, -mark-
Is this method static? If so you can simply call it using the class name
If it isn't static, then your question doesn't make much sense to me. Not only do you need to find the classes that implement the interface, you also need to call the method using objects of said interface. I don't know of anyway to arbitrarily troll memory for instances of a specific class. Perhaps if you explain the overall problem that you are trying to solve, then we can give you suggestions to help you towards the solution. Off the top of my head, one solution is to keep a list of the instances in one of your classes. Every time a new instance is created and it needs the certain method called, this new instance can register itself with the list of these instances. This is similar to how the event mechanism works in Java. HTH Layne
I think a static method is what I want to implement. Thanks for your help, and sorry for my somewhat vague problem description. I haven't programmed in java in a few months and I'm feeling a little rusty.
Joined: Dec 06, 2001
No prob! I'm glad something in my rambling gave you an idea for a possible solution to your problem. Keep coding! Layne
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com