Prefixing interface names with I
I don't like it. I don't do it, unless I'm forced to (by ruling conventions or by customer/project "guidelines").
Worth mentioning; since I came to DotNet from Java, where it's not done, I'm used to not doing it.
But since it's standard in the DotNet framework and de-facto standard in DotNet projects I've thought about it from time to time, as well as discussed it with my colleagues.
My current on this issue is:
I don't think it's the way to go. Because;
a) It reveals to the client that it's using an interface, the client shouldn't care.
b) If the interface is removed (due to refactoring) and replaced with a concrete class, the typename change and all references has to change.
c) If a concrete class is abstracted (due to refactoring) and replaced with an interface, the typename changes and all references has to change.
Therefore; I don't think that interface names should be prefixed or suffixed with anything. If it's really important to the client to know whether it's using an interface or a concrete class it can always find out by browsing the source or using reflection...








0 Comments:
Post a Comment
<< Home