Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A class per file or multiple classes per file?
Message
De
23/05/2006 18:57:06
 
 
À
23/05/2006 18:43:47
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01124405
Message ID:
01124419
Vues:
8
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform