Mu Mike wrote: > dont you think this is too strict? nah, not really :D. There are *loads* of reasons to always only use interfaces when defining communication between components. Avalon enforces it. You'll get behaviour like this in fortress, merlin, phoenix, various AOP frameworks (like nanning) and other containers (IoC or not).
> every implementaion of a Service must have all its public methods > declared in the interface,and if you happen to need to add a public > method to a specific implemetation class, you must declare it in the > Interface,and since other implementations may need not use that method, > you will have to have an abstract class also,just such a right rule. > > no need and no way to break the rule? generally, nope. It's designed to be unbreakable. That said, you could modify fortress and plug in a proxy manager/factory that doesn't do the proxying, but I'm not too sure how atm. Nor should you want to :D If a specific implementation class exposes a method not in the interface, then you can't freely "hot-swap" different implementation classes anyway. And if you can't hot swap, that means that your components have different work interfaces. And if they have different work interfaces, you should make your "client components" know about the difference. The solution to your specific issue is probably (can't be sure since I'm not writing your app :D) to add a more specific work interface, and use that: public interface Thing // basic work interface { void doStuff(); } public interface ExtendedThing extends Thing // has the extra method { void doOtherStuff(); } public class MyThing implements Thing { /* ... */ } public class MyPowerThing implements ExtendedThing { /* ... */ } // in the client... public void service( ServiceManager sm ) throws ServiceException { if( !sm.contains( ExtendedThing.ROLE ) ) { log.warn("degraded service...no " + ExtendedThing.ROLE + " available!"); Thing mything = sm.lookup( Thing.ROLE ); } } hope this helps! (if it does, I'd appreciate someone adding this to our online-editable FAQ at http://wiki.apache.org/avalon/AvalonFAQ) cheers, -LSD --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]