Thursday 6 September 2012

FAQs -I-Design Patterns

Design patterns MVC and MVVM uses Widely

MVC , MVVM aren't these two patterns design patterns.
Yes , both MVC and MVVM are UI design.

The other design patterns prominently used in MVC and MVVM are:
a. Observer pattern
b. Command pattern
c. Strategy pattern
d. Inversion of Control

The design principle used here are
S - Separation of Concern
O - Open- Closed Principle
D - Dependency Inversion

If we use Entity Framework and RIA Services will be using the Repository Pattern as well.

What does a View Model Contain?

It is important to note that the ViewModel does not describe how the view looks. It describes how the view functions, and what information it provides to the user.
 

Difference between View and User Control

while a View is a UserControl, a UserControl is not necessarily a View
 

Do you think developer in MVVM shouldn't contain any code

Developers should refrain from writing any code in the View's code behind file that doesn't pertain purely to the GUI.
 

View and View Model Relationship

A view should only have one viewmodel but  a single viewmodel might be used by multiple views

What are the two things necessary for MVVM?

  •  A class that is either a DependencyObject or implements INotifyPropertyChanged to fully support data-binding, and
  • Some sort of commanding support.

When will you use design patterns ...Always?

A pattern is useful when it accelerates development, improves stability and performance, reduces risk, and so forth. When it slows development, introduces problems, and has your developers cringing whenever they hear the phrase "design pattern", might want to rethink on the approach.
 
 

 

No comments:

Post a Comment