Talk:ClarityOfTypes

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(confusion on Provider interface)
Line 1: Line 1:
 +
JT said:
The originally protected abstract methods are moved to Provider interface. Interface methods are public and this might seem like a contradiction to ClarityOfAccessModifiers. However, it is not. The instances '''of Provider interface are not accessible to clients of the API. They are hidden and only useful for the create factory method that turns them into NonMixed instances.''' As such they are single meaning methods with only one message: implement me, don't call me!. Their clarity is kept.
The originally protected abstract methods are moved to Provider interface. Interface methods are public and this might seem like a contradiction to ClarityOfAccessModifiers. However, it is not. The instances '''of Provider interface are not accessible to clients of the API. They are hidden and only useful for the create factory method that turns them into NonMixed instances.''' As such they are single meaning methods with only one message: implement me, don't call me!. Their clarity is kept.
OK the above is totally confusing. The Provider interface is a public interface residing within a public class (which itself I experience as confusing, but that's a stylistic issue). I can implement this interface and throw it around at will. For that reason, instances of the interface are accessible to clients of the API. For the same reason, they say to me- implement me and do whatever you want with me, including call me. All of this is of course just the opposite of what the books says.
OK the above is totally confusing. The Provider interface is a public interface residing within a public class (which itself I experience as confusing, but that's a stylistic issue). I can implement this interface and throw it around at will. For that reason, instances of the interface are accessible to clients of the API. For the same reason, they say to me- implement me and do whatever you want with me, including call me. All of this is of course just the opposite of what the books says.

Revision as of 20:40, 9 April 2009

JT said: The originally protected abstract methods are moved to Provider interface. Interface methods are public and this might seem like a contradiction to ClarityOfAccessModifiers. However, it is not. The instances of Provider interface are not accessible to clients of the API. They are hidden and only useful for the create factory method that turns them into NonMixed instances. As such they are single meaning methods with only one message: implement me, don't call me!. Their clarity is kept.

OK the above is totally confusing. The Provider interface is a public interface residing within a public class (which itself I experience as confusing, but that's a stylistic issue). I can implement this interface and throw it around at will. For that reason, instances of the interface are accessible to clients of the API. For the same reason, they say to me- implement me and do whatever you want with me, including call me. All of this is of course just the opposite of what the books says.

Personal tools
buy