Splitting a class

  • Thread starter Thread starter David
  • Start date Start date
D

David

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
 
David said:
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.
 
Back
Top