...
You are basically set. Instantiation does ***NOT*** work like
this:
Code Block |
---|
ObjectFactory.Create<DessertTopping> (Flavor.Licorice)
|
It works like this:
Code Block |
---|
ObjectFactory.Create<DessertTopping> (ParamList.Create (Flavor.Licorice));
|
ParamList.Create ()
returns a parameter list object and
is a generic, strongly typed method (although it doesn't look like it).
The object factory's Create<DessertTopping>
finds the matching
constructor by reflection (if you have declared that constructor)
and calls it automatically.
If the empty parameter list (ParamList.Empty
) is passed,
then the default constructor is used.