Pasted from <http://msdn.microsoft.com/en-us/library/cc304760.aspx>
When the model is updated, the view also has to be updated to reflect the changes. View updates can be handled in several ways. The Model-View-Presenter variants, Passive View and Supervising Controller, specify different approaches to implementing view updates.
In Passive View, the presenter updates the view to reflect changes in the model. The interaction with the model is handled exclusively by the presenter; the view is not aware of changes in the model.
In Supervising Controller, the view interacts directly with the model to perform simple data-binding that can be defined declaratively, without presenter intervention. The presenter updates the model; it manipulates the state of the view only in cases where complex UI logic that cannot be specified declaratively is required. Examples of complex UI logic might include changing the color of a control or dynamically hiding/showing controls. Figure 1 illustrates the logical view of the Passive View and Supervising Controller variants.
Passive View and Supervising Controller
The decision to use Passive View or Supervising Controller primarily depends on how testable you want your application to be. If testability is a primary concern in your application, Passive View might be more suitable because you can test all the UI logic by testing the presenter. On the other hand, if you prefer code simplicity over full testability, Supervising Controller might be a better option because, for simple UI changes, you do not have to include code in the presenter that updates the view.
When choosing between Passive View and Supervising Controller, consider the following:
- Both variants allow you to increase the testability of your presentation logic.
- Passive View usually provides a larger testing surface than Supervising Controller because all the view update logic is placed in the presenter.
- Supervising Controller typically requires less code than Passive View because the presenter does not perform simple view updates.
For additional information about the Passive View and Supervising Controller patterns, see Glenn Block’s blog.
Posted by yeejie
1/18/2009 11:00 AM |
Pasted from <http://silverlight.net/forums/p/60423/151129.aspx>
Extracted from SDK regarding to entry of GridLength:
The row’s height, or column’s width, expressed as a floating-point value for a pixel count. Typically this is specified as an integer, although interpolation of floating-point values is supported by grid layout.
A convention by which you can size rows or columns to take the remaining available space in a Grid. A star sizing always includes the asterisk character (*), and optionally precedes the asterisk with an integer value that specifies a weighted factor versus other possible star sizings (for example, 3*). The cell size is a percentage of the remaining size of its content. The remaining size is the size of the grid, minus the fixed and auto size. This remaining size is divided in the * rows or columns, proportionaly of the values before.
The column’s width, or the row’s height, described by the literal Auto. The cell size is the size of its content.
Posted by yeejie
1/15/2009 7:00 PM |
Pasted from <http://whatis.techtarget.com/definition/0,,sid9_gci213058,00.html>
A strongly-typed programming language is one in which each type of data (such as integer, character, hexadecimal, packed decimal, and so forth) is predefined as part of the programming language and all constants or variables defined for a given program must be described with one of the data types. Certain operations may be allowable only with certain data types. The language compiler enforces the data typing and use compliance. An advantage of strong data typing is that it imposes a rigorous set of rules on a programmer and thus guarantees a certain consistency of results. A disadvantage is that it prevents the programmer from inventing a data type not anticipated by the developers of the programming language and it limits how “creative” one can be in using a given data type.