Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Does the interface servers all the needs of multiple inheritance?

Does the interface servers all the needs of multiple inheritance?

Scheduled Pinned Locked Moved ASP.NET
questioncsharpbusinessoophelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mic Mathi
    wrote on last edited by
    #1

    I faced a situation that needs a multiple inheritance. Unfortunately .net is not supporting it. I cannot use an "interface" for this purpose. Let me tell you the scenario. I have a data layer class say "clsDL". There is another class for the common functions say "clsCommon"(It is common for all modules). I have several modules in my project (several projects in a solution) each module has its own common class for the common functions in that moule. Every form in the GUI layer has a class in Business layer. The data layer class inherited to "clsCommon" and all the common classes for each module. Now i want to inherite the "clsCommon" and the common class for the particular module into a particular business layer class. I don't want to merge the common functions. If i implement the interface, I have to make an interface for anyone of the two common class and declare the object of that interface class in the business layer class. The problem is that the functions are in these common classes is not same. Therefore, I can't take the advantage of "interface". How can I solve the problem? P.S: Sorry if I make you confused!

    Ken,Mexico(Guanajuato)

    C 1 Reply Last reply
    0
    • M Mic Mathi

      I faced a situation that needs a multiple inheritance. Unfortunately .net is not supporting it. I cannot use an "interface" for this purpose. Let me tell you the scenario. I have a data layer class say "clsDL". There is another class for the common functions say "clsCommon"(It is common for all modules). I have several modules in my project (several projects in a solution) each module has its own common class for the common functions in that moule. Every form in the GUI layer has a class in Business layer. The data layer class inherited to "clsCommon" and all the common classes for each module. Now i want to inherite the "clsCommon" and the common class for the particular module into a particular business layer class. I don't want to merge the common functions. If i implement the interface, I have to make an interface for anyone of the two common class and declare the object of that interface class in the business layer class. The problem is that the functions are in these common classes is not same. Therefore, I can't take the advantage of "interface". How can I solve the problem? P.S: Sorry if I make you confused!

      Ken,Mexico(Guanajuato)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Ken.Hamilton wrote:

      Every form in the GUI layer has a class in Business layer.

      This doesn't make sense, and ties the two layers too closely together.

      Ken.Hamilton wrote:

      Now i want to inherite the "clsCommon" and the common class for the particular module into a particular business layer class.

      This sounds convoluted and messy. Why would your data layer and business layer have the same base class ? The answer is to redesign, this doesn't sound at all right to me.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      M 1 Reply Last reply
      0
      • C Christian Graus

        Ken.Hamilton wrote:

        Every form in the GUI layer has a class in Business layer.

        This doesn't make sense, and ties the two layers too closely together.

        Ken.Hamilton wrote:

        Now i want to inherite the "clsCommon" and the common class for the particular module into a particular business layer class.

        This sounds convoluted and messy. Why would your data layer and business layer have the same base class ? The answer is to redesign, this doesn't sound at all right to me.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        M Offline
        M Offline
        Mic Mathi
        wrote on last edited by
        #3

        Yes i think so. I am sad that my all works become useless. I have work again from the scratch. Can you please give me any useful links of articles about this subject? Thank you

        Ken,Mexico(Guanajuato)

        C 1 Reply Last reply
        0
        • M Mic Mathi

          Yes i think so. I am sad that my all works become useless. I have work again from the scratch. Can you please give me any useful links of articles about this subject? Thank you

          Ken,Mexico(Guanajuato)

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Not off hte top of my head. Just remember, the layers are seperate, they shouldn't have any need for any common base classes, and the business layer should be built around the different business objects, not the different pages.

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          M 1 Reply Last reply
          0
          • C Christian Graus

            Not off hte top of my head. Just remember, the layers are seperate, they shouldn't have any need for any common base classes, and the business layer should be built around the different business objects, not the different pages.

            Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            M Offline
            M Offline
            Mic Mathi
            wrote on last edited by
            #5

            Ok. Even though I didn't fully understand what you trying to say, thanks for your response and the time to spend me. :) Now I am going to sit back and starting to learn what is Data layer, what is Business layer from all the possible resources.

            Ken,Mexico(Guanajuato)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups