Hey Roger,
You should use events in your business-tier classes which would be raised
when the business class has been modified. The presentation layer objects
would then subscribe to that events to receive notifications they are
interested in.
For example:
//////////////////////
// Business tier
//////////////////////
public class Customer
{
...
private string _firstName;
public event EventHandler FirstNameChanged;
public string FirstName
{
get
{
return _firstName;
}
set
{
_firstName = value;
if (null != FirstNameChanged)
{
FirstNameChanged(this, EventArgs.Empty);
}
}
}
}
////////////////////////////
// Presentation tier
////////////////////////////
public class MyForm: Form
{
private Customer _customer;
public MyForm()
{
InitializeComponent();
_customer = new Customer();
_customer.FirstNameChanged += new
EventHandler(CustomerFirstNameChangedHandler);
}
private CustomerFirstNameChangedHandler(object sender, EventArgs e)
{
// React on first name change.
}
}
--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
"Roger Helliwell" <rh********@telus.net> wrote in message
news:m6********************************@4ax.com...
Hey guys,
Subject line says it all. I have many presentation layer objects that
need to be notified when a specific business-tier class has been
modified.
Thanks,
Roger