473,385 Members | 1,326 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,385 software developers and data experts.

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 1403
David <da*****************@revilloc.REMOVETHIS.comwrot e:
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.com>
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.comwrote in message
news:MP************************@msnews.microsoft.c om...
David <da*****************@revilloc.REMOVETHIS.comwrot e:
>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.com>
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
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...
3
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...
8
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...
3
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 )...
1
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"...
3
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...
0
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...
1
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...
3
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 -...
2
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.