The eventing mechanism built into the .NET runtime makes it a piece of cake to implement a simple publisher - subscriber pattern (C# code follows).
public class EmployerPublisher
{
public event PayrollArrivedHandler PayrollArrived;
public void FireEvent(DateTime today)
{
if(PayrollArrived != null)
PayrollArrived(today);
}
}
// Subscriber class - Employee
public class Employee
{
public void OnPayrollArrival(DateTime day)
... [More]