Spring.Net, Feb 2008, PostSharp: A Technical Introduction

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Spring.Net, Feb 2008, PostSharp: A Technical Introduction - Presentation Transcript

    1. PostSharp & Spring.NET 2. PostSharp Architecture
    2. you are now supposed to be woken up!
    3. however, you should already know that!
    4. The Big Picture Plug-Ins PostSharp Core PostSharp Laos Hosts MSBuild Host Command-Line Host Runtime Host
    5. A finer picture PostSharp Core Code Object Model represents a .NET module Module Reader reads a .NET binary assembly into the Code Object Model Module Writer writes the Code Object Model into a binary assembly (using ILASM) Code Weaver provides the infrastructure for MSIL injection Platform Infrastructure executes projects, loads plug-ins, loads and schedules tasks Plug-in performs specific analysis or transformation Host bootstraps PostSharp and invoke project executions Independent Program uses PostSharp without the Platform Infrastructure PostSharp Laos PostSharp4EntLib PostSharp.Samples.Trace custom plug-ins command-line utility MSBuild task PostSharp.Samples.Host custom application servers PostSharp.Samples.Explorer
    6. Core vs. Laos PostSharp Core PostSharp Laos Objective Absolutely free editing of .NET assemblies Aspect-Oriented Programming Easily Primitives Low-Level (MSIL) High-Level Audience ISV, MSIL/PostSharp specialist Everyone Learning Curve Steep High Complexity / Error Proneness High Low Runtime performance Fast Slower Licensing of extensions GPL/Commercial Any
    7. Compared Example: Logging
      • Boring but instructive
      Hello, World
    8. have you done your homework?
    9. The Laos Solution
      • Derive a custom attribute.
      • Implement “event handlers”.
      • Apply/multicast the custom attribute.
      • Compile-time instantiation.
      • Deserialization.
      • Reflector.
    10. The Core Solution
      • Define the Public Interface.
        • Custom Attribute in the example, but anything else is allowed (XML, DSL).
      • Implement the weaver.
        • Advice.
        • Advice Provider (pointcut evaluation).
      • Plug-In Manifest.
      • Discovery.
      • Reflector.
    11. Compound Aspects
      • Implement INotifyPropertyChanged .
    12. Translating the implementation pattern to AOP Aspected Class Property 1 Property 2 Property 3 NotifyPropertyChangedImpl internal OnPropertyChanged event PropertyChanged Property Setter Aspect OnSuccess handler Composition Aspect
    13. Putting it together: Compound Aspect
      • True meta-programming at compile-time.
      • No limitation to custom attributes.
      • The base of PostSharp bridges to Microsoft Enterprise Library or Microsoft Entity Framework.
    14. Summary
      • With PostSharp Core, you are completely free but you have to pay the price.
      • PostSharp Laos allows to do pretty much things, but:
        • It is slower: it generates suboptimal instructions .
        • No division of compile-time and run-time logic.
        • Attention to abuses!
    15.  

    + gfraiteurgfraiteur, 2 years ago

    custom

    422 views, 0 favs, 0 embeds more stats

    More info about this document

    CC Attribution License

    Go to text version

    • Total Views 422
      • 422 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 16
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories