> I think the whole thing comes down to Leon thinking that > classes cannot implement a constant interface, which they can > and, unfortunately do. The important thing, however, is that > they can and that means that your design will be flawed if > you do that. > > Am I getting you right, Leon?
No, as usual, you miss my point. As for your question, I know that it's technically possible for a class to implement a constant interface. It's also technically possible to write something like String a = "blah"; String b = "blah"; if (a==b){ //do what you want. } Both is possible, both would work, and both is crap. What i really don't understand, is, why is an interface, which is not describing a contract, a problem? I think it is not a greater problem, then a class which does nothing, like your constant_holder_class would be. So we have two equal evils, and I prefer the lesser evil, the having__constant_holder_interfaces__evil. Imagine following situation: I have a legacy system (lets call it foo), which I have to use in my application. Let's imagine it speaks xml over http. The legacy system has a set of parameters it undestands. Now, when I write a driver for this system, I would have something like this. IFooDriver - interface describing the driver, for use by the rest of my app. FooDriverImpl - my implementation of this driver, maybe FooSpecificDriverImpl. FooDriverFactory and some needed data classes would exist also. Lets further imagine we have 2 parameters, username and password. Since i don't want to use them as String, I want to create two constants: public static final String PARAM_USERNAME = "username"; public static final String PARAM_PASSWORD = "password"; Where do I place those constants? In my approach, I would create an interface IFooConstants with both constants, and refer in FooDriverImpl by the full name. In your approach, there would be FooConstants class with same constants. The difference seems to be very small, only an 'I' in the class/interface name. But the real difference behind it is, that you got a constant_holder_class which does nothing, and provides no functionality (which is ugly for a class), and I got an interface describing parts of the communication protocol with the legacy system. So why should an interface only be able to describe objects and components and not other 'describeables' like protocols ? Regards Leon --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]