I would not do it like that, I would use a factory instead. The idea of the factory is to put the creation of objects a bit further from the user code, is if you ever need to change how a certain object is created you only have to have a look at the factory.
Also have a look at the factory pattern . In general when creating objects try using a creational pattern, some can be found at this link given the GoF creational patterns. (Design Patterns by GoF (group of four) is one of the best reads with regards to object oriented patterns)
Like this:
public class BCFactory {
public SubClass CreateInstance(string key)
{
var val1 = GetVal1FromKey(key);
var val2 = GetVal2FromKey(key);
// create the actual instance of the subclass
var instance = new SubClass(val1, val2);
return instance;
}
}
public class SubClass {
public SubClass(string val1, string val2) : base(val1, val2)
{
// Do nothing, we just instantiate the base class.
}
}
Used like this:
var key = // your data
var factory = new BCFactory();
var instance = factory.CreateInstance(key);