I have been studying and coding in C# for some time now. But still, I can't figure the usefulness of Interfaces. They bring too little to the table. Other than providing the signatures of function, they do nothing. If I can remember the names and…
I started a new job recently where I am working on a very large application (15M loc). In my previous job we had a similarly large application but (for better or for worse) we used OSGi, which meant the application was broken down into lots of…
At the company I work at, every service class has a corresponding interface.
Is this necessary?
Notes:
Most of these interfaces are only used by a single class
We are not creating any sort of public API
With modern mocking libraries able to…
I always read that composition is to be preferred over inheritance. A blog post on unlike kinds, for example, advocates using composition over inheritance, but I can't see how polymorphism is achieved.
But I have a feeling that when people say…
In Java 8, interfaces can contain implemented methods, static methods, and the so-called "default" methods (which the implementing classes do not need to override).
In my (probably naive) view, there was no need to violate interfaces like this.…
I have been reading "Clean Code" by Robert Martin to hopefully, become a better programmer. While none of it so far has been really ground breaking it has made me think differently about the way I design applications and write code.
There is one…
Studying beginners course on hardware/software interface and operating systems, often come up the topic of if it would be better to replace some hardware parts with software and vice-versa. I can't make the connection.
There's a debate going on in our team at the moment as to whether modifying code design to allow unit testing is a code smell, or to what extent it can be done without being a code smell. This has come about because we're only just starting to put…
"Abstract class" and "interface" are similar concepts, with interface being the more abstract of the two. One differentiating factor is that abstract classes provide method implementations for derived classes when needed. In C#, however, this…
What is better and why? (From interface-design point of view) :
a) To have two Show() and Hide() functions
b) To have one SetVisible(bool visible) function
EDIT: For example some object have visibility state and this functions is used to change…
In C#, the following code is valid
interface I{
int property{get;set;}
}
Which doesn't make any sense to me. This seems to break one of the most important principles of interfaces: lack of state (in other words, no fields). Doesn't the…
Let's say there is a member SomeMethod in an interface ISomeInterface as follows:
public interface ISomeInterface
{
int SomeMethod(string a);
}
For the purposes of my program, all consumers of ISomeInterface act upon the assumption that the…
In Rich Hickey's thought-provoking goto conference keynote "The Value of Values" at 29 minutes he's talking about the overhead of a language like Java and makes a statement like, "All those interfaces kill your reuse." What does he mean? Is that…
Possible Duplicate:
Why are interfaces useful?
Like most faculty, my java faculty introduced interface without explaining or even mentioning its practical use. Now I imagine interfaces have a very specific use, but can't seem to find the…