How do you make a Factory that can return derived types?
- by Seth Spearman
I have created a factory class called AlarmFactory as such...
1 class AlarmFactory
2 {
3 public static Alarm GetAlarm(AlarmTypes alarmType) //factory ensures that correct alarm is returned and right func pointer for trigger creator.
4 {
5 switch (alarmType)
6 {
7 case AlarmTypes.Heartbeat:…