Bart J.F. De Smet Software Development Engineer Microsoft Corporation Session Code: DTL315.

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Co- location Mass Market Managed Hosting ISV Hosting.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Connect with life Connect with life
NEXT: Overview – Sharing skills & code.
demo Receive Inventory Export Parse and Normalize.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

Jeff Neafsey Mobility Architect Microsoft Corporation WMB402.
customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

Mark Michaelis Chief Computer Nerd IDesign/Itron/IntelliTechture DTL313.
Scott Morrison Program Manager Microsoft Corporation Session Code: WUX308.
9/11/2018 5:53 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Tech·Ed North America /14/2018 7:13 PM
Возможности Excel 2010, о которых следует знать
Sysinternals Tutorials
Title of Presentation 11/22/2018 3:34 PM
11/21/2018 4:57 AM SIA303 Advanced Persistent Threats (APT): Understanding the New Era of Attacks! Marcus Murray Security Team Manager, Microsoft MVP –
Title of Presentation 12/2/2018 3:48 PM
Brian Keller Sr. Technical Evangelist Microsoft Session Code: DEV310
12/5/2018 3:24 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Brian Keller Sr. Technical Evangelist Microsoft Session Code: DEV310
Microsoft SharePoint Conference 2009 Jon Flanders
Peter Provost Sr. Program Manager Microsoft Session Code: DEV312
Building Silverlight Apps with RIA Services
Tech Ed North America /12/2019 6:45 AM Required Slide
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
2010 Microsoft BI Conference
Tech·Ed North America /25/ :53 PM
Hack-proofing your Clients using Windows 7 Security!
How and When to Use MEF: Too Much Is Never Enough
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Lap Around the Windows Azure Platform
Code First Development in Microsoft ADO.NET Entity Framework 4.1
Building BI applications using PowerPivot for Excel
Title of Presentation 5/24/2019 1:26 PM
Title of Presentation 7/24/2019 8:53 PM
Presentation transcript:

Bart J.F. De Smet Software Development Engineer Microsoft Corporation Session Code: DTL315

Agenda Why extensibility matters Extensibility the naïve way MEF versus System.Addin Core concepts Lots of demos Summary

Extensibility in pictures Source:

Customer versus developer Source: Source:

Extensibility is hard Looks familiar? Too hard?

Take a step back interface IMathBinOp { string Name { get; } int Calculate(int a, int b); } IMathBinOp GetOperation(string path, string type) { Assembly asm = Assembly.LoadFrom(path); return (IMathBinOp)Activator.CreateInstance( asm.Name, type ); } ContractContract Dynamic load Name the 10 problems…

Extensibility the naïve way Bart J.F. De Smet Software Development Engineer Microsoft Corporation

Agenda Why extensibility matters Extensibility the naïve way MEF versus System.Addin Core concepts Lots of demos Summary

Managed Extensibility Framework Parts have a contract are found in a catalog compose in a container Square with 4 pins I have these blocks Let’s build something

System.Addin in a nutshell Cross- process or appdomain Versioning adaptation The essence of an add-in

Is System.Addin overkill? System.Addin Isolation boundaries Activation of add-ins Across CLR versions MEF Composition engine at its core Utilities for discovery Simple declarative model Answer: complimentary technologies

Agenda Why extensibility matters Extensibility the naïve way MEF versus System.Addin Core concepts Lots of demos Summary

A world of give and take ImportExport Composed “I need” “I have”

Composition Host application Need a IMathBinOp Extension A Have a IMathBinOp MEF composition engine [Export][Export] [Import][Import] PartPart PartPart

Import and Export in practice interface IMathBinOp { string Name { get; } int Calculate(int a, int b); } class Calculator { [Import] public IMathBinOp Operator { get; set; } } [Export(typeof(IMathBinOp))] class Add : IMathBinOp { // Implementation } ContractContract ImportImport ExportExport Host application Extension

How to compose? CompositionContainer Wiring “surface” where magic happens CompositionBatch Contains the parts to be wired together ContainerContainer BatchBatch PartPart Compose

Import and Export in practice class App { static void Main() { var calc = new Calculator(); using (var container = new CompositionContainer()) { var batch = new CompositionBatch(); batch.AddPart(calc); batch.AddPart(new Add()); container.Compose(batch); } var res = calc.Operator.Calculate(1,2); } } Manual composition

Simple composition Bart J.F. De Smet Software Development Engineer Microsoft Corporation

Advanced topics in import/export Named contracts Typically based on Type Can also be string-based ImportMany For use with collections E.g. calculator has many operations Instantiation control Which constructor to run? Part creation policies (sharing of instances)

Where do parts come from? Concept of a catalog Type catalog – explicit list of types Assembly catalog – attributed types in an assembly Directory catalog – based on directory search Aggregate catalog – allows combining catalogs Union operation ComposablePartCatalog base class Queryable for parts ( Parts ) Search exports for a given import ( GetExports )

Using a DirectoryCatalog class App { static void Main() { var calc = new Calculator(); var catalog = new DirectoryCatalog(EXTPATH); using (var container = new CompositionContainer(catalog)) { var batch = new CompositionBatch(); batch.AddPart(calc); container.Compose(batch); } var res = calc.Operator.Calculate(1,2); } } Search path

Working with catalogs Bart J.F. De Smet Software Development Engineer Microsoft Corporation

Agenda Why extensibility matters Extensibility the naïve way MEF versus System.Addin Core concepts Lots of demos Summary

Selection of MEF Preview 6 samples Bart J.F. De Smet Software Development Engineer Microsoft Corporation

Agenda Why extensibility matters Extensibility the naïve way MEF versus System.Addin Core concepts Lots of demos Summary

The ABC CCC of MEF Extensibility ComposeCatalogContract

Sessions On-Demand & Community Resources for IT Professionals Resources for Developers Microsoft Certification & Training Resources Resources

Related Content Breakout Sessions (session codes and titles) Interactive Theater Sessions (session codes and titles) Hands-on Labs (session codes and titles)

Track Resources Resource 1 Resource 2 Resource 3 Resource 4

Complete an evaluation on CommNet and enter to win! Required Slide

© 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. Required Slide