Designing types so that they interact well with the CLR and Framework Library requires some effort. When designing the interface of a type, and defining the type’s interaction with other types, modeling the problem domain is usually the highest priority. This is quite reasonable, and is one of the main benefits object-oriented programming offers. Taking a type whose semantics were developed from an analysis of the problem domain and getting it to work efficiently with the CLR is the subject of this chapter. Any type that can pass the tests of a compiler and be converted into intermediate language will enjoy a reasonable existence with other CLR types, but when efficiency and elegance are important design goals, conforming to CLR design patterns is an important consideration.
KeywordsExpense Encapsulation Allo Alloca
Unable to display preview. Download preview PDF.