Re: Restricting Inheriting Scope of a class

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Rahul Arora" <rk.rahul@xxxxxxxxx> wrote in message
news:1141626870.239629.17750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi All,

I am designing some class for my DataLayer. The scenario is i have
three classess Class1,Class2,Class3. Class1 is base class for class2
and class3. It's a DLL project. What my problem is i want only class2
and class3 to be viewed as the part of the DLL and Class1 should be
hidden. Class1 is used only for deriving Class2 and Class3 in my DLL.
Once i compile the DLL and include in my application, it shows all
three classes there but i dont want class1 to appear there. Is this
possible ??? if yes..plz. suggest the way it can be implemented. I dont
want to create any other DLL for my Base class Class1. Basically i want
the scope of Class1 to be restricted to it's assembly only and Class2
and Class2 should be available to other assembilies....Please help...

You can't do it (despite what other postings might say).

You cannot have a base class less accessible than the derived class. i.e.
there is no possibility of inheritance form implementation only as in C++.

What you CAN do is make all the Class1 methods internal so that they can
only be called by your classes.


.



Relevant Pages

  • Restricting Inheriting Scope of a class
    ... Class1 is base class for class2 ... It's a DLL project. ... What my problem is i want only class2 ... and class3 to be viewed as the part of the DLL and Class1 should be ...
    (microsoft.public.dotnet.framework)
  • Re: UML und java
    ... Hat bei dieser UML Darstellung Class2 auch eine Variable von Class1? ... Komposition und Aggregation in Java wirklich kein Unterschied? ... private Wort wort; ...
    (de.comp.lang.java)
  • UML und java
    ... Hat bei dieser UML Darstellung Class2 auch eine Variable von Class1? ... Komposition und Aggregation in Java wirklich kein Unterschied? ... Angenommen ich möchte einen Satz objektorientiert darstellen. ...
    (de.comp.lang.java)
  • Re: Subclassing VBA/VB6/.Net
    ... You'd want Instancing of the 2nd class ... If these classes are in a standard EXE ... In Class1, you'd create an instance of Class2 in the Initialize event. ...
    (microsoft.public.vb.general.discussion)
  • Re: HashTable.Add Modifies HashTable Items?
    ... BaseClass(Of Class1) and the other is BaseClass(Of Class2). ... public static int Next ... public static int x = Counter.Next; ...
    (microsoft.public.dotnet.framework)