The Situation In Which You Will Go For Interface Or Conceptual Class

Interfaces, similar to classes, characterize an arrangement of properties, strategies, and occasions. However, dissimilar to classes, interfaces don't give usage. They are executed by classes, and characterized as particular elements from classes. Despite the fact that class legacy enables your classes to acquire execution from a base class, it likewise drives you to settle on the greater part of your outline choices when the class is first distributed.

Conceptual classes are valuable while making segments since they permit you indicate an invariant level of usefulness in a few techniques, however leave the execution of different strategies until the point that a particular usage of that class is required. They likewise form well, on the grounds that if extra usefulness is required in inferred classes, it can be added to the base class without breaking code.
  1. A unique technique is made by indicating the theoretical sort modifier.
  2. A unique technique contains no body.
  3. A unique technique isn't executed by the base class.
  4. A unique technique is consequently virtual.
  5. A determined class must abrogate it.
  6. Conceptual class can have modifiers for methods,properties and so on.,
  7. A conceptual class can actualize a property.
  8. The conceptual modifier can't be connected to static strategies.
  9. Properties can likewise be conceptual.
  10. A class containing theoretical techniques must be proclaimed as conceptual with the dynamic specifier.
  11. There can be no objects of a dynamic class.
  12. If a determined class doesn't actualize the greater part of the conceptual strategies in the base class, at that point the inferred class should likewise be indicated as theoretical.
  13. A theoretical class can acquire from a class and at least one interfaces.
  14. A unique class can execute code with non-Theoretical strategies.
  15. Unique class can have steady and fields.
  16. A unique class can have constructors or destructor's.
  17. A unique class can't be acquired from by structures.
  18. A unique class can't bolster different legacy.
  19. On the off chance that we add another technique to a dynamic class then we have the choice of giving default execution and accordingly all the current code may work appropriately.
  1. Interfaces can't be instantiated specifically.
  2. Interfaces can contain occasions, strategy, indexer and properties.
  3. An Interface can contain property definitions.
  4. Interfaces contain no usage of strategies.
  5. Classes and Structs can execute more than one interface.
  6. An Interface can be acquired from by structures.
  7. An interface itself can acquire from numerous interfaces (Interface can bolster different legacy).
  8. A conceptual class can actualize a property.
  9. In the event that we add another strategy to an Interface then we need to find every one of the executions of the interface and characterize usage for the new technique.
Next Recommended Reading Go Back to the previous page in ASP.NET