lundi 20 novembre 2017

Hierarchical dependency resolutions in inheritance c#

To maintain the separation of concern, I am trying to create the layered project architecture. lets consider below example.

  • ProjectA is class library and has

    • interface IntefaceA
    • Abstract Class ClassA implements InterfaceA
  • ProjectB is class library and reference ProjectA and has

    • Abstract Class ClassB inherit ClassA ( PrjectA reference added in ProjectB )
  • ProjectC has
    • Class ClassC which inherited from ClassB so added ProjectB as reference in ProjectC

Now issue is, in ProjectC I am getting error The type ClassA is defined in an assembly that is not referenced

Questions is

  1. Why ProjectC need ProjectA reference
  2. Do I need to add all the referenced project all way to the hierarchical chain
  3. How can I achieve separated design while reducing the dependency

Aucun commentaire:

Enregistrer un commentaire