If I have partial classes in C#, what should the file names be?
The class is called partial class Logic
and would exist out of two or maybe three separate files.
If I have partial classes in C#, what should the file names be?
The class is called partial class Logic
and would exist out of two or maybe three separate files.
For a class called Logic
, I'd probably go for Logic.something.cs
(where "something" is different for each file). This would be in the same style as the partial classes that Visual Studio generates (eg. the .designer.cs
files for forms)
I would only use Partial Classes if I am generating code (CodeSmith, MyGeneration, Template Files (TT)). Microsoft have done a good job of doing this with generated proxies and datasets etc. As the code will be generated again in teh future it allows you to seperate out logic which you want to include but dont want overwritten.
Standard Based Upon Microsoft .NET Library Standards http://10rem.net/articles/net-naming-conventions-and-programming-standards---best-practices
Pascal Case, no underscores or leading "C" or "cls".
Classes may begin with an "I" only if the letter following the I is not capitalized, otherwise it looks like an Interface.
Classes should not have the same name as the namespace in which they reside. Any acronyms of three or more letters should be pascal case, not all caps. Try to avoid abbreviations, and try to always use nouns. Why: This convention is consistent with the .NET Framework and is easy to read.
Examples Include
Here is an MS link on naming conventions http://msdn.microsoft.com/en-us/library/xzf533w0(v=vs.71).aspx
Whatever you want but: