2

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 emitted 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.

Johan Danforth
  • 4,469
  • 6
  • 37
  • 36

1 Answers1

1

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.

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443