ria 1.0 aa we need…. we need….. bbcc ria 1.0 we need….. ddeeffgghhiijjkk we need…

37
Building Extensible Rich Internet Applications with the Managed Extensibility Framework Glenn Block Program Manager Microsoft Corporation

Upload: mathew-odiorne

Post on 02-Apr-2015

231 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Building Extensible Rich Internet Applications with the Managed Extensibility FrameworkGlenn BlockProgram ManagerMicrosoft Corporation

Page 2: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

What we’ll cover

Page 3: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

RIA Extensions, add-ins, and plugins oh my!

Page 4: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Extensibility implants

Page 5: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Turning fat apps into slimmer apps

Page 6: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Reality

RIA 1.0

Page 7: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Reality

A

We need….

We need…..

BC

RIA 1.0

We need…..

D

EF

GH

IJ

K

We need…..We need…..

We need…..

We need…..

We need…..

We need…..

We need….

Page 8: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Managed Extensibility Framework

The Managed Extensibility Framework (MEF) is a new library in Silverlight 4 for building applications that can be incrementally extended.

> For customers> For you and your team > Always there, always ready

Page 9: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

MEF Basics…An Application is built of

parts.

Page 10: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Hello MEF in Silverlight

Demo

Page 11: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

MEF Basics…

Export it.

Import it.

Compose it.

Page 12: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Export it.

Widget1

[Export(typeof(UserControl))]public class Widget1 : UserControl{

public string Message { get{return(string) Button.Content;}

set{Button.Content=value;} }}

Export

UserControl

Page 13: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Import it.

Widget1

[Export(typeof(UserControl))]public class Widget1 : UserControl{

[Import]public string Message { get{return(string) Button.Content;}

set{Button.Content=value;} }}

Import

String

Page 14: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Import it.

Widget1

[Export(typeof(UserControl))]public class Widget1 : UserControl{

[Import(“HelloMEF.Message”)]public string Message { get{return(string) Button.Content;}

set{Button.Content=value;} }}

Import

“HelloMEF.Message”

Page 15: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Import it.

MainPage

[Export(typeof(UserControl))]public class MainPage: UserControl{

[ImportMany(typeof(UserControl))]public IEnumerable<UserControl> { get;set;}

}

ImportMany

UserControl

Page 16: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Compose it.

PartIntializer: “Compose yourself”

MainPage Compose

public MainPage() { InitializeComponent(); PartInitializer.SatisfyImports(this); }

Page 17: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Be different – Use metadata

Page 18: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Widget

Widget

Where does the widget

go?

Page 19: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Export it - Metadata

Widget1

[ExportMetadata(“Location”,Location.Top)][Export(typeof(UserControl))]public class Widget1 : UserControl{

public string Message { get{return(string) Button.Content;}

set{Button.Content=value;} }}

Export

UserControl

Put me in the top

Page 20: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Import it - Metadata

MainPage

[Export(typeof(UserControl))]public class MainPage: UserControl{

[ImportMany(typeof(UserControl))]public IEnumerable<Lazy<UserControl, IWidgetMetadata> { get;set;}

}

ImportMany

UserControl

Page 21: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Have it your way! – Custom Exports

Page 22: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Export it - Metadata

Widget1

[ExportMetadata(“Location”,Location.Top)][Export(typeof(UserControl))]public class Widget1 : UserControl{

public string Message { get{return(string) Button.Content;}

set{Button.Content=value;} }}

Export

UserControl

Put me in the top

Page 23: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Customize it – Custom exports

Widget1

[Widget(Location=Location.Top)]public class Widget1 : UserControl{

public string Message { get{return(string) Button.Content;}

set{Button.Content=value;} }}

Export

UserControl

Put me in the top

Page 24: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Putting it all together

Demo

Page 25: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Trim up your appsbreak up your XAPs

Demo

Page 26: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

MEF and Prism

Ariel [email protected]/blogs/arielbh

DeveloperSela Group

partner

Page 27: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Introducing MEF-Prism integration

> Our Goal :

Enable an existing Prism application to be further extended through

MEF

> Enabled MEF modules to be added dynamically on the fly.

> Enable MEF discovered components to be registered in IoC container (Such as Unity).

Page 28: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Introducing MEF-Prism integration

> Prism application starts and loads up known modules.

Module Loader

Page 29: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Introducing MEF-Prism integration> Prism application can load unknown

plugins, by using MEF as an abstraction layer.

1. Plugins are located and added to a MEF catalog.

Server

Page 30: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Introducing MEF-Prism integration> Prism application can load unknown

plugins, by using MEF as an abstraction layer.

2. Plugins register dependencies with current IoC container.

Server

Page 31: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Introducing MEF-Prism integration> Prism application can load unknown

plugins, by using MEF as an abstraction layer.

3. Plugins are activated. Dependencies are injected.

Server

Page 32: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Where can I get it?

> MEF ships in Silverlight 4.0> Dynamic XAP support in SL 4.0 Toolkit> Silverlight 3.0 support on Codeplex> MEF source ships under MSPL

Learn more:Silverlight.netMEF.Codeplex.comMEFContrib.Codeplex.com – Prism/MEFblogs.msdn.com/gblock

Page 33: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

MEF Cross-platform(s)

Jackson [email protected] Software EngineerMoonlight Project

partner

Page 34: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

YOUR FEEDBACK IS IMPORTANT TO US!

Please fill out session evaluation

forms online atMicrosoftPDC.com

Page 35: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

Learn More On Channel 9

> Expand your PDC experience through Channel 9

> Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses

channel9.msdn.com/learnBuilt by Developers for Developers….

Page 36: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 37: RIA 1.0 AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need…