HOME

TheInfoList



OR:

MVC4WPF for
computer software Software consists of computer programs that instruct the Execution (computing), execution of a computer. Software also includes design documents and specifications. The history of software is closely tied to the development of digital comput ...
is an open-source, extensible, automated code pattern developed at Information Control Corporation for
Windows Presentation Foundation Windows Presentation Foundation (WPF) is a free and open-source user interface framework for Windows-based desktop applications. WPF applications are based in .NET, and are primarily developed using C# and XAML. Originally developed by Microso ...
(WPF) development based on the
Model–View–Controller Model–view–controller (MVC) is a software architectural pattern commonly used for developing user interfaces that divides the related program logic into three interconnected elements. These elements are: * the model, the internal representat ...
(MVC) and Presentation–Abstraction–Control (PAC) patterns. It was released to the general public as an open source project o
July 23, 2009
It depends on Microsoft's .NET Framework 3.5 and
Visual Studio 2008 Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including web site, websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development ...
for functionality. The MVC4WPF source code for the 0.9 beta is available fo
download
on CodePlex.


Pattern description

MVC4WPF is not a new
architectural pattern Software architecture pattern is a reusable, proven solution to a specific, recurring problem focused on architectural design challenges, which can be applied within various architectural styles. Examples Some examples of architectural patte ...
but is rather a hybrid derived from two older patterns supported by an automation system and development tenets. The authors refer to it as an automated code pattern rather than a framework because design frameworks create a logical environment that must be used in a precise manner; whereas, MVC4WPF promotes a more flexible environment that is intended to be adapted to the solution without restrictions. However, MVC4WPF does support code libraries, snippets, and uses the supporting language associated with WPF (
XAML Extensible Application Markup Language (XAML ) is a declarative XML-based language developed by Microsoft for initializing structured values and objects. It is available under Microsoft's Open Specification Promise. XAML is used extensively i ...
), giving it many characteristics of a
design pattern A design pattern is the re-usable form of a solution to a design problem. The idea was introduced by the architect Christopher Alexander and has been adapted for various other disciplines, particularly software engineering. The " Gang of Four" ...
. Creator
Stephen Giffin
and John Hannah state in their three part broadcast on
Channel 9 (discussion forum) Channel 9 was a Microsoft website for hosting videos and podcasts that Microsoft employees create. Launched in 2004 when Microsoft's corporate reputation was at a low, Channel 9 was the company's first blog. It was named after the United Airline ...
that MVC4WPF is designed to take advantage of the MVC pattern's flexibility in problem solving while the PAC pattern provides a hierarchy through parent-child controller interactions. All interactions between layers are managed by contracts which dictate the terms which parent and child layers interact. Because of these contracts, the model, view and controller layers have a great deal of flexibility in how they interact, handle data, or are constructed. All that is required is that contract terms are met. For example, a model (data) layer may consist of a local database, Web feeds, or any other information provided that the given model meets all of the requirements of its contract. This contract-centered approach increases the potential flexibility of applications as well as proscribes the conditions for testing code (i.e. contracts set the testing conditions). It also promotes development specialization, as developers only need to understand their area of expertise and how to meet their contract requirements. The hierarchical flow of the pattern
/ref> stems from the parent-child relationships. Controllers always hold parent relationships to Views and Models, while Controllers can be parents or children to other Controllers. As such, Controller layers drive much of the pattern and receive information from any Controller that is one of its children. Because of this design and WPF's ability to propagate information internally, passing data up and down parent-child relationships becomes very efficient, requiring little supporting code. MVC4WPF is intended primarily for creating enterprise applications in which teams of specialists may work together to create specific areas or in applications which demand a well-defined hierarchical flow. It is not intended for very small projects. The pattern is made up of the following elements: Model: as per the MVC pattern, the Model represents the application data layer. In MVC4WPF, it is always a child in a parent-child relationship with a controller. View: as per the MVC pattern, the View represents the user interface and immediate code behind. In MVC4WPF, it is always a child in a parent-child relationship with a controller. The View can be one of three types: page, window, or user control. Controller: as per the MVC pattern, the Controller represents the business logic and driving functions of the pattern. The Controller drives all operations. Controllers have parent-child relationships with other controllers. They are always the parents in relationships with Models and Views. Contracts: Contracts are the means by which parent and child elements will interact, whether Controller-View, Controller-Model, or Controller-Controller. Development in MVC4WPF is largely driven by how contracts are assigned, so contracts are usually discussed and defined first. The relationships defined in these contracts are what allow development and UX teams to work independently of each other and still successfully integrate the different parts of the application. Property Bags: Property bags are elements of contracts that define the properties shared by the parent and child functions. Controllers have property bags associated with them as necessary.


See also

*
Model View Controller A model is an informative representation of an object, person, or system. The term originally denoted the plans of a building in late 16th-century English, and derived via French and Italian ultimately from Latin , . Models can be divided into ...
* Model View Presenter * Presentation-abstraction-control


References


External links

{{Official website, mvc4wpf.com Software design patterns Software architecture