MVP pattern IxxxView question
Hi Scott,
I am reading the MVP pattern section of Ch. 8, and I am wondering the following:
Why do you create a view interface (IxxxView) that has properties that in the implementation only sets some value? Why not just create methods? e.g.
In ProductDetail.aspx.cs, you have
publicdecimal Price
{
set { this.litPrice.Text = String.Format("{0:C}", value); }
}
Why not create a method and its interface named SetPrice which does the same thing (setting litPrice.Text value).
It seems more appropriate to use methods instead of write-only properties for this page (and other pages in this MVP project).
|