473,651 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Private" classes

Hi

if I am developing a "class library" which contains some classes which
should be exposed to the outside world, and other classes which I really
would rather have "private" to my library (helper/utility classes), how do
I achieve this?

Obviously public classes can just be declared "public". But how do I make
classes available only to the other classes which are a part of my library?

Thanks,
Peter
Dec 17 '07 #1
4 1867
"internal" or nothing at all (internal is the default)

Marc
Dec 17 '07 #2
Hello Peter,

consider using "assembly friendship" for this
http://msdn2.microsoft.com/en-us/lib...xk(VS.80).aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
PKHi
PK>
PKif I am developing a "class library" which contains some classes
PKwhich should be exposed to the outside world, and other classes
PKwhich I really would rather have "private" to my library
PK(helper/utility classes), how do I achieve this?
PK>
PKObviously public classes can just be declared "public". But how do I
PKmake classes available only to the other classes which are a part of
PKmy library?
PK>
PKThanks,
PKPeter
Dec 17 '07 #3
"Marc Gravell" <ma**********@g mail.comwrote in news:u4OtaeJQIH A.4740
@TK2MSFTNGP02.p hx.gbl:
"internal" or nothing at all (internal is the default)
Yeah thanks - I did track that down myself, and tried to "delete" my
question, but you were already on the ball!
Dec 17 '07 #4
On Dec 17, 10:31 am, "Marc Gravell" <marc.grav...@g mail.comwrote:
"internal" or nothing at all (internal is the default)
.... for top-level types :)

(Nested types are private by default.)

Jon, pedant in residence
Dec 17 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
3313
by: Scott Brady Drummonds | last post by:
Hi, everyone, I'm still learning Python as I develop a medium-sized project. From my previous experience with C++, I've burnt into my mind the notion of information hiding. I'm having trouble understanding to what extent I should follow this policy in my Python code so I thought I'd ask the group. I read from a previous post that to attain a private-like status of member variables, I should prefix the variable name with two...
8
2828
by: Etienne Boucher | last post by:
Nested classes are usualy objects made to only live in their parent object instance. In other words... public class Outter { public class Inner { } }
16
2043
by: Joe Strout | last post by:
One thing I miss as I move from REALbasic to Python is the ability to have static storage within a method -- i.e. storage that is persistent between calls, but not visible outside the method. I frequently use this for such things as caching, or for keeping track of how many objects a factory function has created, and so on. Today it occurred to me to use a mutable object as the default value of a parameter. A simple example: def...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8460
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.