Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A class per file or multiple classes per file?
Message
From
23/05/2006 18:57:06
 
 
To
23/05/2006 18:43:47
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01124405
Message ID:
01124419
Views:
11
>I will often put several non-visual classes in one class library (one file) and for visual classes it's usually one class per file. A notable exception being my class library that sub-classes all the UI controls ... you know, TextBox, ComboBox, etc. Though these are visual objects, they can't be sub-classed visually and since there's potentially not much code in some of those sub-classes, I don't find it a very good idea to have a file for each class.

Another "it depends" :)

For me, I have two classes that contains over 2000 lines of code. So, having them in separate files with the name of file as the class name, for naming convention, it was also a good decision for me. Now, as to know about those who think that a class should be really small in terms of coding, well, they are entitled to their opinions. For me, the list and the data entry classes are two big huge classes that need to be defined as is for my own standardization. And, I like that as is. :)
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform