• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
MEF in Silverlight 4
 

MEF in Silverlight 4

on

  • 1,135 views

My MEF Slidedeck from german VSone 2011

My MEF Slidedeck from german VSone 2011

Statistics

Views

Total Views
1,135
Views on SlideShare
1,082
Embed Views
53

Actions

Likes
0
Downloads
7
Comments
0

1 Embed 53

http://dotnet-forum.de 53

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    MEF in Silverlight 4 MEF in Silverlight 4 Presentation Transcript

    • MEF
      Managed Extensibility Framework
    • Thorsten Hans
      Teamlead .NET & SharePoint Development @ Data One GmbH
      Author
      .NET Magazin, IT Republik, SharePoint Magazin
      Speaker
      ADC, SharePoint Konferenz, VSOne, .NET DevCon, See#Party
      Kontakt
      thorsten.hans@gmail.com
      Web
      http://www.dotnet-rocks.de
      http://www.ironruby-rocks.com
      http://www.twitter.com/ThorstenHans
    • MEF?!
      Beginner
      Import
      Export
      Compose
      Intermediate
      Custom Catalogs
      Recomposition
      Advanced
      Lazy Support
      (Typed) Metadata
      Roadmap
    • MEF?!
      Build extensibleApplications
      Extension Deployment with minimal effort
      Provide Metadata for Extensions to improve usability
    • Who is using MEF?
      Microsoft Visual Studio 2010
      Mono
      Caliburn / CaliburnMicro
      RavenDB
      Typemock (TestLint)
    • Beginner
      Beginner
    • Beginner
      MEF is part of
      Silverlight 4.0
      .NET Framework 4.0
      As extension it’s also available for
      .NET Framework 3.5
      Silverlight 3
    • Core Elements
      MEF is built of only three core elements
      • Import
      • Export
      • Compose
    • Core Concept
      Your App
      3. Compose
      1. Import
      Any Component
      2. Export
    • Exports
      Export
      • An Export is a piece of logic
      • Is represented by
      • a class
      • a property
      • a field
      • Decorated with MEF-Attributes
    • Imports
      Import
      • An Import is an extension point
      • Is represented by
      • a property
      • a constructor parameter
      • a field
      • a method
      • Decorated with MEF-Attributes
    • Composition
      Compose
      • Heart of MEF
      • The CompositionInitializer Class
      • Separated by containers
      • Normally the application itself
    • Intermediate
      Intermediate
    • Custom Catalogs
      Custom Catalogs
      Used for locating the Exports
      • Type based
      • Assembly based
      • Deployment Item based
    • Recomposition
      Recomposition
      Reevaluating Exports
      • occurs at runtime
      • Imports have to enable recomposition
    • Default Catalog
      Default Catalog
      All assemblies from current XAP are loaded by default
    • Advanced - MEF
      Advanced
    • Lazy Support
      Lazy support
      • Instances will be created on demand
      • Based on default .NET 4.0 Lazy Loading
      • Lazy<T>
    • Metadata
      Metadata
      • Specify your exports
      • Weakly typed metadata
      • Strongly typed metadata
      • Requires lazy loading
    • Weakly typed Metadata
      Weakly typed Metadata
      • ExportMetadataAttribute
      • KeyValuePair
      • string / object
      • Imports require a new type
      • Lazy<IComponent,IDictionary<String,Object>>
    • Strongly typed Metadata
      Strongly typed Metadata
      • 1. Custom Attribute
      • Requires default CTOR which calls base CTOR
      • Decorated with MetadataAttribute
    • Strongly typed Metadata
      Strongly typed Metadata
      • 2. a public interface
      • All properties within the interface have to be named and typed as in the Attribte class
      • All properties have to be readonly
    • Strongly typed Metadata
      Strongly typed Metadata
      • Imports need to be changed
      • Lazy<IComponent, IMetadataInterface>
    • More Information on MEF?
      see
      mef.codeplex.com
    • FRAGEN?Thorsten.hans@gmail.com
    • Wir sehen uns wieder!
      Konferenz speziell zu C++
      05. – 06. Mai 2011, direkt am Chiemseecpp.ADC2011.de
      Trainings und Events der ppedv
      Mehr als 100 verschiedene Trainings
      auf Microsoft-Technologien spezialisiert
      11 Standorte in D & AT
      Maßgeschneiderte Trainings direkt bei Ihnen vor Ort!
      www.ppedv.de
    • Hat Ihnen mein Vortrag gefallen?Ich freue mich auf Ihr Feedback!
    • Vielen Dank!
      Dein Name