Best practice for assembly and class names when generating dynamic assemblies and types?
I'm generating a dynamic proxy in .NET with TypeBuilder and Emit and there are lots of names going on - assembly name, module name and type names. Is there a best practice or a set of general good ideas around naming of a dynamic proxy, or 开发者_如何学Goemitted classes in general? Should the generated proxy contain a name and a random number to prevent class name collisions and so on?
Thanks for any help.
Usually, you will name your class like this:
MeaningfulName_GUID
This solves both problems: In stack traces, you have a speaking name for the class, but because of the GUID in the class name there will be no collisions.
精彩评论