I think SA1402 is a great rule but I have problem with generics. I've got a class that uses the Func
delegate, so the names roughly parallel that signature. That is, I have classes named Operation<TType>
, Operation<T, TType>
, Operation<T1, T2, TType>
and so on. According to SA1402, I need to put all these small classes in separate files and come up with some strange decoration for the file name. Additionally, if I need to change one of these items I'll typically need to make changes to the rest. This seems less supportable than a single module.
Does it make sense for SA1402 to allow generics of the same basic class (as well as partials) to reside in one file? In this case all permutations of the class Operation
would reside in 'Operation.cs'.
They are several nameing convension. It seems the most popular is
Operation[TType].cs
Operation[T,TType].cs
Operation[T1, T2, TType].cs
But you can also use something more classic, like
Operation`1.cs
Operation`2.cs
Operation`3.cs
(see Convention for Filenames of Generic Classes)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With