Prism v2 - Intro To Composite Application Guidance and Library
Prism v2 - Intro To Composite Application Guidance and Library
Modular, Composite
Application
Distributed Agile Team
Reverses baldness
Fluent Interfaces
Multi-Targeting
Silverlight and WPF
Routed Commands &
Routed Events
High Performance Dev
Increases your IQ 42
points
Data Binding
Architect (not Astronaut)
Introduction to Prism
Building Silverlight and WPF apps
with
Composite Applications Guidance
and
Composite Application Library
Bill Wilder
http://blog.codingoutloud.com
Terminology
Prism code name (which I will call it)
Prism v2 talking about 2nd release
Composite Application Guidance for
WPF and Silverlight official name
of whole package
Composite Application Library for
WPF and Silverlight runtime
support included sometimes called
CAL
f
f
US businesses annually spend ~tu
$250 billion on
software dev across approx 175,000
projects
s
Only 16 percent of these projects
s
finish on
i
schedule and within budget
h
t
y
Another 31 percent are cancelled,
mainly due
s
o
a
to quality problems
s
e
,
Another 53 percent
exceed
their budgets by an
t
y
average of 189
percent
a
n
i
k
Projects reaching a
completion deliver an average
O
of only 42 percent of the originally planned
features
Industry
Response
Product Groups
Events
.NET events
Tight coupling (references in both directions)
WPF events
Looser coupling,
tree
(generally)
Composite events
Looserer coupling; not limited to same visual
tree
Prism Conventions+
Bootstrapper
Shell
One module per DLL
M-V-VM pattern
Silverlight
WPF
Prism
First Cut At
SaveAsPodcast App
Look at some code
Easier to Test
Now possible to Unit Test (vs. Integration Test)
Simpler problem isolation
ViewModel Pattern
Load external
data from
web services,
etc.
View
Data
Binding
ViewModel
Your Glue
Mode
l
Supported by WPF / SL
Powerful Data
Binding glue
provided free with
both Silverlight and
Custom code
(boring);
Automapper is
promising
Mode
l
UI is the data
store for much of
the data (e.g.,
ListBox); logic
Custom code to
populate UI
Port SaveAsPodcast to
Prism
M-V-VM
Modules
Eventing
Event Filtering
When to go Composite?
(1/2)
You are designing complex WPF or
Silverlight applications, or
You are building an application that
presents information from multiple
sources through an integrated user
interface, or
You are developing, testing, and deploying
modules independently of other modules,
or
[Source CAL docs]
When to go Composite?
(2/2)
Your app will add more views and more
functionality over the coming years, or
You must be able to change the app
quickly and safely to meet emergent
business requirements, or
Your app is being developed by multiple
collaborating teams; or
Your app targets both WPF and
Silverlight, and you want to maximize
code sharing between platforms.
[Source CAL docs]
When to NOT go
Composite?
Your apps do not require any of the above
scenarios, or
Your application consists of a few simple
screens, or
You are building a prototype or demo, or
Your developers are not familiar with the
ideas and practices and do not have the
time to learn them. * COMPLEMENTARY
*
(remember the opening slide)
to
n
o
s
m
a
s
i
e
r Pr
g
e
n
s
o
r oo
W h
c
Why Prism
SoC + SRP + reducing plumbing code +
Unit Tests best way to handle
complexity and enable ability to
respond rapidly to requirement changes
M-V-VM best way to support the
previous item (in SL/WPF)
Prism best way to support the
previous item
Official Site
http://microsoft.com/composit
ewpf
-- or --
http://codeplex.com/composit
ewpf
Prism v2 References
http://www.microsoft.com/downloads/details.
aspx?FamilyID=fa07e1ce-ca3f-4b9b-a21b-e3fa1
0d013dd&DisplayLang=en
http://blogs.msdn.com/jmeier/archive/2009/02/1
8/new-release-composite-application-guidance-f
or-wpf-and-silverlight-v2-0-prism.aspx
http://timheuer.com/blog/archive/2009/02/18/pri
sm-2-released-composite-guidance-for-silverligh
t-lob.aspx
http://msdnrss.thecoderblogs.com/2009/02/18/co
mposite-application-guidance-for-wpf-and-silve
rlight-v20-prism/
http://tinyurl.com/d4s22b
Other Resources
Josh Smith on MVVM with WPF:
http://msdn.microsoft.com/en-us/magazine/dd4196
63.aspx
Brian Noyes on Understanding Routed Events and
Routed Commands in WPF:
http://msdn.microsoft.com/en-us/magazine/cc7854
80.aspx
WPF Commanding Overview:
http://msdn.microsoft.com/en-us/library/ms752308
.aspx
Martin Fowlers description of Presentation Model
pattern:
http://martinfowler.com/eaaDev/PresentationModel
.html
XAML Guidelines for Creating a Composite UI:
http://msdn.microsoft.com/enus/library/dd458877.aspx
Question
s?