Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Restricting Inheriting Scope of a class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rahul Arora - 06 Mar 2006 06:34 GMT
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...

Rahul Arora
Nick Hounsome - 06 Mar 2006 08:03 GMT
> Hi All,
>
[quoted text clipped - 9 lines]
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.