avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: [VOTE] RE: ComponentManager interface [QUESTIONNAIRE]
Date Mon, 18 Feb 2002 19:23:33 GMT

I apologize for being harsh and maybe rude, but a questionnaire where the
questioner's own opinions are embedded in the multiple-choice answers is
not a good questionnaire and you will not get anything out of it.
You will not be able to draw any conclusions

> From: Stephen McConnell [mailto:mcconnell@apache.org]
> While 
> I applaud the pragmatism you demonstrate in ignoring the 
> the objectives and aspirations of others, I remain 
> convinced that the best result will be achieved by 
> exploring, evaluating, and qualifying the interests of 
> all concerned. 

Well, that was a nonsense assertion about my motives and
you do very nicely point out the faults of it. I agree

What I argue against is:

   Your idea that splitting up a single interface among
   several just to avoid having any "optional" methods,
   such as release() is good architecture and SOC.

All it does it leading to splitting of one whole into
several fragments. A strawman argument:

Consider the class Color. It has red, green and blue
intensities. Would you consider this good architecture:

public interface ColorRedGettable {
   public float getRed ();

public interface ColorGreenGettable {
   public float getGreen ();

public interface ColorBlueGettable {
   public float getBlue ();

public interface ColorRedSettable {
   public void setRed (float red);

public interface ColorGreenSettable {
   public void setGreen (float green);

public interface ColorBlueSettable {
   public void setBlue (float blue);

public class ColorImpl implements ColorRedGettable, ColorRedSettable, ... 
{ ... }

I thought not. Since everyone will wand the full Color
interface, it makes more sense to do this:

public interface Color {
   public float getRed ();
   public float getGreen ();
   public float getBlue ();

public class ColorImpl implements Color {
... }

for a read-only variant. 

I have the same reaction to your proposed ServiceManager/ServiceResolver/etc.
All you do is split a single interface across several. The only
time I consider it a good thing would be if there are methods
in the interface that can not be implemented - when some implementations
can not live up to the contract imposed by the interface.

The thing is that the release() method is only needed if the manager
supports pooling. The contract is upheld with an empty method.

It would be different if the release() method could not do anything
sensible and be forced to throw an UnsupportedOperationException.
Then I could understand the need to separate it out in a separate 
interface. But in this case all implementations can honor the contract
imposed by the full, release-having, interface. Adding more
interfaces just adds more complexity.


To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

View raw message