Solved this via Composition...
Created an abstract Bakeable<T>
class as
public abstract Bakeable<T> : IBakeable<T>
{
event EventHandler OnCooked;
public Cooked(object sender)
{
var handler = this.OnCooked;
if (handler != null)
{
handler(sender, new EventArgs());
}
}
}
Created an IBakeable<Pie>
property which is the Bakeable<Pie>
class
for firing the event called BakeablePie.Cooked
;
for attaching to the event it simply became oven.BakeablePie.OnCooked += customerWantsPie.Eat
I'm really not sure how this helps me in regard to Hans' comment in order to cook more things I need to add more properties