Until C# 3.0, the only real solution to this was to write one or more factory methods. These are described in the sidebar below. But now we have another option.
With C# 3.0 the language was extended to support
object initializers—an extension to the
new syntax that lets us set up a load of
properties, by name, as we create our object instance.
Example 3-35 shows how an object
initializer looks when we use it in our
Main function. ...