473,414 Members | 1,627 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

How to splitt a large class into two or more files ?

Hello,
is it (in c#) possible, to splitt a large class into two or more files ?
If yes, how can I do that ?

Thanks
Heinz
Nov 15 '05 #1
4 1737
Heinz Zimmermann <no*****@hzi.de> wrote:
is it (in c#) possible, to splitt a large class into two or more files ?
Not at the moment. It will be in Whidbey (the next version).
If yes, how can I do that ?


Can I ask why your class is very large in the first place? It's
*usually* (but not always) a sign that you need to split your class
into more classes to start with.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
my problem is:
i have a namespace, say "MyControls"
in this namespace there are is a control "TheControl" and numerous helper
classes and enumerations belonging to this control
what i want to do:
in class browser, only the main class (the control) should be visible, all
helper classes are reachable by MyControls.TheControl.MyHelperClass
i see two possibilities:

1. namespace: i can't create a namespace MyControls.TheControl if there
already is a class MyControls.TheControl
2. embedded classes: if i make all the helper classes embedded classes of
the main class MyControls.TheControl, then the TheControl.cs file explodes
because i have to merge in all Helper cs files

or is there another way to reach this?

"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Heinz Zimmermann <no*****@hzi.de> wrote:
is it (in c#) possible, to splitt a large class into two or more files ?


Not at the moment. It will be in Whidbey (the next version).
If yes, how can I do that ?


Can I ask why your class is very large in the first place? It's
*usually* (but not always) a sign that you need to split your class
into more classes to start with.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #3
Heinz Zimmermann wrote:
is it (in c#) possible, to splitt a large class into two or more files ?
If yes, how can I do that ?


Switch to MC++ or wait until the next version.

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
Nov 15 '05 #4
Heinz Zimmermann <no*****@hzi.de> wrote:
my problem is:
i have a namespace, say "MyControls"
in this namespace there are is a control "TheControl" and numerous helper
classes and enumerations belonging to this control
what i want to do:
in class browser, only the main class (the control) should be visible, all
helper classes are reachable by MyControls.TheControl.MyHelperClass
i see two possibilities:

1. namespace: i can't create a namespace MyControls.TheControl if there
already is a class MyControls.TheControl
2. embedded classes: if i make all the helper classes embedded classes of
the main class MyControls.TheControl, then the TheControl.cs file explodes
because i have to merge in all Helper cs files

or is there another way to reach this?


If you have a load of helper classes, you might even consider moving to
a separate assmebly for each control, and have those helper classes as
internal. Otherwise, you could certainly change to group your controls
by namespace, or even have MyControls.Helpers for internal helper
classes. That unfortunately doesn't give the same level of protection
as having them private to the containing class, of course.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #5

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

Similar topics

2
by: Edvard Majakari | last post by:
Hi all ya unit-testing experts there :) Code I'm working on has to parse large and complex files and detect equally complex and large amount of errors before the contents of the file is fed to...
36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
7
by: matvdl | last post by:
I have migrated my asp application to asp.net some time ago - but I am still having some difficulties in understanding the best way to mange some tasks. I currently have a page that loads a aspx...
3
by: A.M-SG | last post by:
Hi, I have a ASP.NET aspx file that needs to pass large images from a network storage to client browser. The requirement is that users cannot have access to the network share. The aspx file...
4
by: =?Utf-8?B?VzFsZDBuZTc0?= | last post by:
When one architects a new project one of the first steps in the decision is to decide on the layers. (In my opinion anyway) One architecture that I have used before is to go solid OO and create...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
3
by: Jeff Jarrell | last post by:
We are migrating a large app to .net. There are many forms and there will be many, many icons. What are some suggested techniques for more or less sharing imagelists (easy enough), BUT without...
5
by: SuvarnaChaudhari | last post by:
Plz help me. How can I splitt the following string. 0A896>078957345:0A875>075456478:A5647>75647 (It depends on user how many row he selects.) In this string first number is patient id while second...
5
by: chrispoliquin | last post by:
I need to represent the hyperlinks between a large number of HTML files as a graph. My non-directed graph will have about 63,000 nodes and and probably close to 500,000 edges. I have looked...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.