I have to share some webApi request and response with another team. I created a .Net Core 2.0 project containing all Interfaces.
They ask me to have real class instead of interfaces, is it correct? i wolud to share on interfaces and not class
I have to share some webApi request and response with another team. I created a .Net Core 2.0 project containing all Interfaces.
They ask me to have real class instead of interfaces, is it correct? i wolud to share on interfaces and not class
What is an interface?
An interface, or protocol as it is sometimes called, is a device that is used to allow unrelated objects to interact with one another, by implementing an agreed upon system of behavior. When a class implements an interface, the class agrees to implement all of the methods defined in the interface. Interfaces are useful since they capture similiarity between unrelated objects without forcing a class relationship. Furthermore, interfaces may consist of either abstract methods or entire abstract classes. One class uses an interface by using the "implements" keyword, and example might look like this:
Classes in Java are almost the same as C++ classes, in that they define an abstract datatype, with its particular fields and methods. Each object is an instance of a class, and follows the class prototype that defines the variables and methods common to all objects of a certain kind. Each instance of a class must be instantiated, after it is declared, unlike in C++. This is usually done with the keyword "new".
What is a class?
Classes may have inheritance from other classes, as they do in C++, meaning they incherit all the properties of the parent class. This is usually done with the keyword "extends". So for example, a simple sub-class declaration with inheritance from another class might look like this:
class Window extends Frame {}
The new class is window which contains all the properties of a Frame. Mind you, sub-classes are not limited to the properties they inherit, they may add variables and methods of their own, and can even override inherited methods as well. Each class must have its own header file, which is included at the beginning of the code with an "import". Classes are what provide Java its modularity, in that multiple objects may be created as instances of the same class.
Choose Interfaces