473,811 Members | 3,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Splitting a class

Hi,

Using C#, .NET 1.1

I have a class that has many methods. It is my datalayer. Some methods are
related to each other and I want to make my code more manageable by
seperating the related methods.

Is there any way I can put my related methods into seperate files while
still maintaining those methods as part of the class?

I have seen that .NET 2 has partial classes (not yet sure what they do) but
is there anything I can do for .net 1.1?

Thanks.

Best regards,
Dave Colliver.
http://www.BedfordFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Jan 20 '07 #1
2 1420
David <da************ *****@revilloc. REMOVETHIS.comw rote:
Using C#, .NET 1.1

I have a class that has many methods. It is my datalayer. Some methods are
related to each other and I want to make my code more manageable by
seperating the related methods.

Is there any way I can put my related methods into seperate files while
still maintaining those methods as part of the class?

I have seen that .NET 2 has partial classes (not yet sure what they do) but
is there anything I can do for .net 1.1?
There's nothing equivalent to partial classes in 1.1, but if your class
is particularly large (and particularly if it breaks up into "chunks"
of methods neatly) you should quite possibly consider breaking the
class itself (rather than just the source code) into several classes.
Think about whether you could compose a "top level" class from multiple
classes which neatly encapsulate part of the behaviour/state without
needing to relate to the rest of the existing class.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 20 '07 #2
Thanks. I thought maybe not.

I will try and split the class up.

Best regards,
Dave Colliver.
http://www.BathFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Jon Skeet [C# MVP]" <sk***@pobox.co mwrote in message
news:MP******** *************** *@msnews.micros oft.com...
David <da************ *****@revilloc. REMOVETHIS.comw rote:
>Using C#, .NET 1.1

I have a class that has many methods. It is my datalayer. Some methods
are
related to each other and I want to make my code more manageable by
seperating the related methods.

Is there any way I can put my related methods into seperate files while
still maintaining those methods as part of the class?

I have seen that .NET 2 has partial classes (not yet sure what they do)
but
is there anything I can do for .net 1.1?

There's nothing equivalent to partial classes in 1.1, but if your class
is particularly large (and particularly if it breaks up into "chunks"
of methods neatly) you should quite possibly consider breaking the
class itself (rather than just the source code) into several classes.
Think about whether you could compose a "top level" class from multiple
classes which neatly encapsulate part of the behaviour/state without
needing to relate to the rest of the existing class.

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

Jan 20 '07 #3

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

Similar topics

3
3311
by: Sandman | last post by:
I am splitting a text block into paragraphs, to be able to add images and stuff like that to a specific paragraph in a content management system. Well, right now I'm splittin on two or more newlines, so this text block: Hello, my nickname is Sandman and I am coding some PHP Call me
3
2540
by: William Ahern | last post by:
I'm looking for resources on splitting and merging XML trees. Specifically, on methods to pare large XML documents into smaller documents which can be merged later. Off of the top of my head, I can envision unions of node sets, and unions of node text. But I know there's much more to the subject than that, if not more alternatives than greater technical detail. TIA,
8
1575
by: M O J O | last post by:
Hi, I'm creating an CRM solution for my company. I want to split up the solution into several classlibraries, so I dont need to build the entire solution every time I run my project. First I thought about splitting my application up into these libraries: Solution (solution)
3
4150
by: Rakesh | last post by:
Hi, I was 'googling' to look out for some ways of optimizing the code and came across this term - 'hot / cold splitting'. In short, the discussion is about splitting heavily accessed ( hot ) portions of data structure from rarely accessed cold portions. I haven't used this one myself anytime before, but am interested in learning more about this. Can you please share your experience here, so that I can understand better and this could...
1
1744
by: Andy Britcliffe | last post by:
Hi I'm faced with the situation where I could have a single physical file that could contain multiplie XML documents e.g file.txt contains the following: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE doc SYSTEM "1.0b.dtd"> <doc transmission-date="20050715T154340Z" >
3
1028
by: Corobori | last post by:
I developed a vb.net application which has about 90 forms an 70 reports. I have got the following question: my customer asked me to split up my application in several application. One containing the complete application, and different application each of them containing a different subset of functionalities. How can I do this ?
0
932
by: melis | last post by:
Hi all, I am new to MFC, and cannot find a way to the following problem :( What I am trying to do is just to split the window into two parts, tyring to have a CFormView or CDialog on left and a Cview on the right. I found lots of examples and tried them all-now I want to make a new project from scratch, when I try to do so, I have no problem in splitting the window to two Cviews but get an assert failure error when I try it with to use...
1
1371
by: Gustav | last post by:
Hi! I use a regex (?<!\\?)('|\\+|:) to split a string to a String. The String i get after splitting is correctly splitted but contains all the delimiters i use to decide where the string should be splitted. Do I have to loop through the array and find every index containing a single delimiter or is there a easier way to do this.
3
1969
by: jb | last post by:
Am using the 'Web Application Project' model for an asp.net web app. Sections of this now need to be reusable. Is it possible to split into sub projects? What happens with /bin directory if so - are there bins in each subproject? What happens with sessions? Thanks JB
2
3278
by: shadow_ | last post by:
Hi i m new at C and trying to write a parser and a string class. Basicly program will read data from file and splits it into lines then lines to words. i used strtok function for splitting data to lines it worked quite well but srttok isnot working for multiple blank or commas. Can strtok do this kind of splitting if it cant what should i use . Unal
0
9730
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10651
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...
1
10403
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,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
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
5555
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...
1
4341
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
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.