Click here to Skip to main content
15,888,216 members
Home / Discussions / C#
   

C#

 
AnswerRe: Breaking Up Classes Pin
TheGreatAndPowerfulOz27-Jan-11 13:43
TheGreatAndPowerfulOz27-Jan-11 13:43 
GeneralRe: Breaking Up Classes Pin
GlobX27-Jan-11 14:03
GlobX27-Jan-11 14:03 
GeneralRe: Breaking Up Classes Pin
PIEBALDconsult27-Jan-11 14:13
mvePIEBALDconsult27-Jan-11 14:13 
AnswerRe: Breaking Up Classes PinPopular
Luc Pattyn27-Jan-11 13:07
sitebuilderLuc Pattyn27-Jan-11 13:07 
GeneralRe: Breaking Up Classes Pin
inayathussaintoori27-Jan-11 14:04
inayathussaintoori27-Jan-11 14:04 
GeneralRe: Breaking Up Classes Pin
musefan28-Jan-11 5:58
musefan28-Jan-11 5:58 
GeneralRe: Breaking Up Classes Pin
Luc Pattyn28-Jan-11 6:14
sitebuilderLuc Pattyn28-Jan-11 6:14 
AnswerRe: Breaking Up Classes Pin
PIEBALDconsult27-Jan-11 14:09
mvePIEBALDconsult27-Jan-11 14:09 
Size doesn't matter... well, not directly anyway.

How many people are working on the project? I prefer to keep files small to reduce the need for multiple developers needing to modify the same file at the same time (an ounce of prevention is worth a pound of cure). The goal, then is to split it up into functional sections, and I do like partial classes. At the extreme (and I know extremes) you can have one method per file, but even I don't go that far (yet). The next thing is to put overloaded versions of one method in one file. And you can put similar methods (like operators) in one file. Basically, I'd say that it's better to have too many parts than too few.

Some of my "largest" classes are Data Access Layers -- all the methods that access tables in a particular database. Unfortunately, with many, I started writing them before partial classes were introduced so each is in one big file Dead | X| . More recent DALs I split into a section for each table. You could, instead, make a section for inserts, another for deletes, etc., but that doesn't seem right. It also doesn't seem right to develop separate classes for each table or action.

So if you have separate files for each table, you can assign Alice to work on Employee methods and Bob to work on Department methods, etc.
AnswerRead this ebook from los techies about the SOLID principles Pin
i.j.russell28-Jan-11 1:36
i.j.russell28-Jan-11 1:36 
AnswerRe: Breaking Up Classes Pin
Alan Balkany28-Jan-11 3:07
Alan Balkany28-Jan-11 3:07 
AnswerRe: Breaking Up Classes Pin
fjdiewornncalwe28-Jan-11 4:12
professionalfjdiewornncalwe28-Jan-11 4:12 
QuestionUSB device detection upon program startup Pin
Blubbo27-Jan-11 9:51
Blubbo27-Jan-11 9:51 
AnswerRe: USB device detection upon program startup Pin
Luc Pattyn27-Jan-11 11:02
sitebuilderLuc Pattyn27-Jan-11 11:02 
GeneralRe: USB device detection upon program startup Pin
Blubbo27-Jan-11 16:46
Blubbo27-Jan-11 16:46 
AnswerRe: USB device detection upon program startup Pin
Luc Pattyn27-Jan-11 17:25
sitebuilderLuc Pattyn27-Jan-11 17:25 
Questionproblem with dynamic ips when using sockets. Pin
prasadbuddhika27-Jan-11 6:25
prasadbuddhika27-Jan-11 6:25 
AnswerRe: problem with dynamic ips when using sockets. Pin
Yusuf27-Jan-11 6:30
Yusuf27-Jan-11 6:30 
AnswerRe: problem with dynamic ips when using sockets. Pin
Richard MacCutchan27-Jan-11 7:15
mveRichard MacCutchan27-Jan-11 7:15 
GeneralRe: problem with dynamic ips when using sockets. Pin
prasadbuddhika27-Jan-11 19:23
prasadbuddhika27-Jan-11 19:23 
GeneralRe: problem with dynamic ips when using sockets. Pin
Richard MacCutchan27-Jan-11 22:45
mveRichard MacCutchan27-Jan-11 22:45 
AnswerRe: problem with dynamic ips when using sockets. Pin
jschell27-Jan-11 8:37
jschell27-Jan-11 8:37 
QuestionEquivalent way to achieve const or readonly return type from method Pin
bob1697227-Jan-11 5:09
bob1697227-Jan-11 5:09 
AnswerRe: Equivalent way to achieve const or readonly return type from method Pin
_Erik_27-Jan-11 5:33
_Erik_27-Jan-11 5:33 
AnswerRe: Equivalent way to achieve const or readonly return type from method Pin
Luc Pattyn27-Jan-11 5:36
sitebuilderLuc Pattyn27-Jan-11 5:36 
AnswerRe: Equivalent way to achieve const or readonly return type from method PinPopular
jschell27-Jan-11 8:45
jschell27-Jan-11 8:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.