Soft serve prism
-
Upload
dotnetusergroupdnipro -
Category
Technology
-
view
645 -
download
2
Transcript of Soft serve prism
Presenter: Sergiy Beslik
Prism - Composite Application Guidance for WPF and Silverlight
What is Composite Application?
Composite Application consists of loosely coupled modules that can be developed independently, discovered at runtime and work together.
What is Prism?
Prism is a set of guidance designed to help building composite UI applications with WPF and Silverlight.
Application
Client
Server
Database
Prism
What is Prism?
Library Reference Implementation Guidelines Quick-Starts
Prism Core Concepts
Modules UI Composition Dependency Injection Events and Commands Separated Presentation
Patterns Multi-targeting
Modules
Unit of development– Modules can be developed and tested independently by
different teams. Unit of deployment
– Modules can be loaded on demand, minimizing application start-up time.
– Modules can be added or changed without re-building the whole application.
Bootstrapper
Bootstrapper
Module A
public class ModuleA : IModule { public void Initialize() {
UI Composition
Views from multiple modules are displayed at run time in specific locations within the application's UI.
<TabControl RegionManager.RegionName = “MainContentRegion” />
Module A
<ItemsControl RegionManager.RegionName= “NavigationRegion">
Module B
View Discovery vs. View Injection
Views can be instantiated automatically when region is displayed, or explicitly injected into region.
Dependency Injection
ClassA
ObjectBuilder
ClassB
«interface»IClassB
«creates»
«uses»
«creates»
ClassA ServiceLocator
ClassB
«interface»IClassB
«uses»
«creates»
Dependency Injection Pattern Service Locator Pattern
Events and Commands
Delegate Command– Implements delegate-based
Command pattern Composite Command
– Implements multiple handlers command routing
Event Aggregator– Implements publishing and
subscribing to loosely coupled events
Event Aggregator
Event Aggregator is a mediator service that allows decoupling of publishers and subscribers.
Module A
eventAggregator.GetEvent<MyEvent>().Publish(eventArgs)
eventAggregator.GetEvent<MyEvent>().Subscribe(MyEventHandler, ThreadOption.UIThread, false, MyEventFilter);
Module B
Separate Presentation Patterns
Model-View-Controller (MVC) Model-View-Presenter (MVP) Presentation Model (PM) Model-View-ViewModel (MVVM)
View Controller
Model
Model-View-Controller
View Presenter
Model
Model-View-Presenter
Model-View-ViewModel Pattern
Vie
w
Vie
wM
odel
Mod
el
Data binding
ICommand
Read
Write
Update events
Prism Reference Implementation
Demo…
Prism Releases
Prism 1.0 – WPF, July 2008 Prism 2.0 – WPF & Silverlight 2.0, Feb 2009 Prism 2.1 – WPF & Silverlight 3.0, Oct 2009 Prism 2.2 – WPF & Silverlight 4.0, May 2010 Prism 4.0 – WPF & Silverlight 4.0, beta version is
available
What’s new in Prism 4.0
WPF 4.0 Support More ViewModel Pattern Guidance Managed Extensibility Framework (MEF) Support Guidance For Out of Browser Applications Application Structure Patterns & Navigation
Useful links
MSDN Magazine article “Patterns For Building Composite Applications With WPF”: http://msdn.microsoft.com/en-us/magazine/cc785479.aspx
MSDN Magazine article “WPF Apps with the Model-View-ViewModel Design Pattern”: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
PowerPoint presentation and video from Patterns & Practices Symposium in Kiev, September 2010: http://www.techdays.in.ua/videos/2897.html
Download latest version of Prism: http://compositewpf.codeplex.com/releases/view/46046
Thank You!
Copyright © 2010 SoftServe, Inc.
Contacts
Europe Headquarters 52 V. Velykoho Str.Lviv 79053, Ukraine
Tel: +380-32-240-9090Fax: +380-32-240-9080
E-mail: [email protected]: www.softserveinc.com
US Headquarters12800 University Drive, Suite 250Fort Myers, FL 33907, USA
Tel: 239-690-3111 Fax: 239-690-3116