Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A class per file or multiple classes per file?
Message
De
24/05/2006 15:07:05
Mike Yearwood
Toronto, Ontario, Canada
 
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:
01124647
Vues:
15
>>Hi,
>>
>>If the class hierarchies are reasonably shallow there may be a case for putting the classes in the same .cs. Advantage is that you can use source control to make sure, for example, that incompatable changes aren't made to a parent class whilst working on a derived class.
>>
>>Just my .02c,
>
>Thanks Viv! That's an addtional thing to take into consideration: source control.

This example requires team member discussion, not source control. If the super/parent class is undergoing changes at the same time as the derived class the two developers should have discussed the nature of the changes. This is a good thing for productivity. Having the files separate means no integration process is required. Having them in one .cs means an integration process may be required. End result is bad either way, if no discussion was had.

This example should be done as if the superclass is being changed separately from the derived class. Test, test, test! Roll back with source control if it goes wrong.

Besides, once the parent classes have stabilized, this should be a very rare occurrence.

IMO, the more common scenario would be where two developers are changing two classes that interact. Discussion, testing and source control would all have to occur for success.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform