Is the StaticFactory in codecampserver a well known pattern?
Posted
by Merritt
on Stack Overflow
See other posts from Stack Overflow
or by Merritt
Published on 2010-04-12T17:03:19Z
Indexed on
2010/04/12
19:23 UTC
Read the original article
Hit count: 336
UPDATE: this is a duplicate of Is the StaticFactory in codecampserver a well known pattern?
Here's the pertinent bit of code:
public class GenericFactory
{
public static Func<object> CreationClosure;
public T GetDefault<T>()
{
return (T) CreationClosure();//executes closure
}
}
© Stack Overflow or respective owner