If you mean the difference between:
Foo<T>()
and
Foo(Type type)
then there are virtues of both. The latter is much more convenient when using reflection to load types (maybe your types Gamecome from plugins?) - generics and reflection do not mix very conveniently.
, ; .., . , T, , Comparer<T>.Default EqualityComparer<T>.Default (: ) - , , .
, T : Game, ( , Game - , ). ; a List<Game> , List<T> ( T : Game), .
, , , :
void Foo<T>() where T : Game
{
Foo(typeof(T));
}
void Foo(Type type) {...}
- , Activator.CreateInstance(type) new T() - T : ISomeInterface. , .