Building Builders

The Builder Pattern is a software design pattern where the logic to set up an object is separated from the actual object. As discussed last time, this patterns is particularly useful when dealing with immutable types where all the information about the object is often required at the time of construction. The builder pattern allows the information required to construct the object to be collected separately by code with different concerns, until the point Build is called to actually construct the object.

With code generation baked into roslyn, patterns such as the Builder Pattern which often require a lot of boilerplate code will be extremely simple to automate. In this post we will investigate how easy this really is.

Read more

Sizing Up the Void

Previously we discovered how to hold an unboxed instance of System.Void, and although circumventing the .NET framework always feels good, it left us with a burning question; What does the memory layout look like? Can a class contain infinite voids?

Read more