What are you using code generation for? What are typical scenarios that allow you to get real value from generating C # code at runtime ? In particular: what are you using for the CodeDOM namespace for?
Codegen on the fly? Do you mean while working? I use this to create high-performance code access that could be used by other sensible uses. In most cases, you can use things like Delegate.CreateDelegate, but there are times when ILGenerator, etc. Have their place.
Delegate.CreateDelegate
ILGenerator
I use this in protobuf-net to access fields at runtime (by creating a wrapper, note the properties use Delegate.CreateDelegate), and in HyperDescriptor to create a faster implementation PropertyDescriptor. But in both cases I use ILGeneratordirectly - not CodeDom.
PropertyDescriptor
In fact, personally, I really would not have studied CodeDom if I hadn't; for runtime to work, I would first look at Expression. I have an article on InfoQ discussing this, or various things here on SO or on my blog that might be interesting.
Expression
codegen - ( ), , . LINQ-to-SQL (SqlMetal), EF .. , codegen. protobuf-net xslt codegen ( .proto); T4, 2.0/mono .., xslt ( ).
, Moq, mocks stubs " " . , Castle.DynamicProxy, , , Reflection.Emit.
, , XML, . XML .NET. CodeDOM.
, XAML. XAML .
, , IMHO dom.
" ". , P (X, Y), X Y, X , Y , , X PX (Y), , P , X. , X, X "" . PX , Y.
: "" . X ( ) Y ( ). X , Y . P (X, Y) . 2 , , 2 18 ., .
, X, , . C X C PX (Y). PX , , . , X, Y. ( C) 0,5 2 3 .
, , . , X PX, Y,
Source: https://habr.com/ru/post/1722932/More articles:WPF controls for collecting controls - data-bindingGet content from a URL using GWT - phpHow to create valid IP ranges given the IP address and subnet mask in Perl? - perlChecking state inside a loop - javaWhen is a cached style sheet updated in Rails? - cachingBuilding Management in C ++ and Good Linux IDEs - c ++Как использовать/изучать API-интерфейсы вывода Video4Linux2 (On Screen Display)? - linuxHow to speed up a SQL query using the group by statement + max command? - sqlC # issue with standard error redirection - multithreadingUsage: order and: restrictions - Ruby On Rails - ruby-on-railsAll Articles