Aspect-oriented programming

Slides:



Advertisements
Similar presentations
Jim McKeeth | Podcast at Delphi.org
Advertisements

© 2007 ATLAS Nantes 1 Atlas Model Weaver Use Case: Aspect Oriented Modeling Marcos Didonet Del Fabro Atlas Group (INRIA & LINA), Université de Nantes,
Aspect Oriented Programming - AspectJ Radhika Rajput.
NCSoft China PD Dept. training - Session 4 -- Lance Zhang
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
.NET Framework Introduction Nouman Qureshi
TDD,BDD and Unit Testing in Ruby
Introduction to .Net Framework
Introduction to the Spring Framework By: Nigusse A. Duguma Kansas State university Department of Computer Science Nov 20, 2007.
Introduction to AOP.
Aspect Oriented Programming (AOP) in.NET Brent Krueger 12/20/13.
The Chameleon Development Environment The Chameleon™ Development Environment Application delivery using Microsoft Excel®
Aspect Oriented Programming Gülşah KARADUMAN.
SE: CHAPTER 7 Writing The Program
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Adaptive Software Kevin Cella Graduate Seminar 02/04/2005.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Aspect Oriented Security Tim Hollebeek, Ph.D.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)
AOP/cross-cutting What is an aspect?. An aspect is a modular unit that cross-cuts other modular units. What means cross-cutting? Apply AOP to AOP. Tease.
Introduction to Yan Cui Aspect Oriented Programming by
Join us on Twitter: #AU2013 Building Well-Performing Autodesk® AutoCAD® Applications Albert Szilvasy Software Architect.
Aspect-Oriented Software Development (AOSD)
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
Guide To Develop Mobile Apps With Titanium. Agenda Overview Installation of Platform SDKs Pros of Appcelerator Titanium Cons of Appcelerator Titanium.
Leveraging ColdSpring to build a robust Flex applications Chris Scott, Cynergy Systems.
Technology In Schools BY Desmond Thomas. How many of you like using technology in school?
Advanced BIML topics Be a W.I.S.E. A.S.S. Me ! Self-employed BI consultant Author Trainer MCT
Dept of Computer Science University of Maryland College Park
What is .NET.
Top 8 Best Programming Languages To Learn
Software Engineering Lecture 7
SmallTalk Done By: Nathalie Arzu Erienne Burgess Shanice Joseph.
Topic: Programming Languages and their Evolution + Intro to Scratch
Jim Fawcett CSE687 – Object Oriented Design Spring 2016
Modern Collections Classes
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Enterprise Library Overview
Fody code weaving made fun.
Demeter Aspects Who We Are Aspectual Collaborations
Introduction CSE 1310 – Introduction to Computers and Programming
The Object-Oriented Thought Process Chapter 08
Digital Measures Replacement
.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.
Programming COMP104: Fundamentals and Methodology Introduction.
SharePoint-Hosted Apps and JavaScript
Object Oriented Practices
Making PowerShell Useful
Interpreter Style Examples
Team Members: Member1, … Spring 2013
Introduction to Software Testing (2nd edition) Chapter 4 TDD Example
DotnetConf 12/3/2018 1:48 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE.
Prototype using PowerPoint
Making PowerShell Useful
Modern Collections Classes
JAsCo an Aspect-Oriented approach tailored for
Stephen W Thomas Using BizTalk Server as your Foundation to the Clouds
15-110: Principles of Computing
Tonga Institute of Higher Education IT 141: Information Systems
Applying Use Cases (Chapters 25,26)
Applying Use Cases (Chapters 25,26)
Tonga Institute of Higher Education IT 141: Information Systems
Finding and using code online
1.3.7 High- and low-level languages and their translators
Jim Fawcett CSE687 – Object Oriented Design Spring 2015
Modern Collections Classes & Generics
Visual Basic for Applications: Introduction
Presentation transcript:

Aspect-oriented programming robert maclean www.sadev.co.za ∞ @rmaclean ∞ robert@sadev.co.za

How is it implemented in PostSharp and how does it work? Agenda What, when, why of AOP? How is it implemented in PostSharp and how does it work? Alternatives to PostSharp Looking to the future Discussion

Every project has “boring” code source: Microsoft Application Architecture Guide, 2nd Edition

Many implementations now days AKA: AOSD AOP Details Goal to make cross cutting concerns easy to implement and focus on business code Xerox PARC in 2001 AspectJ Many implementations now days AKA: AOSD

Scenario code – simple prime calculator Customer says it’s wrong. We need logging to diagnose…

Let’s add logging – trace input & output Easy to miss some places Lots of repetition of code Need to teach this Not portable 5 extra lines of code

What about some procedural help? Not junior friendly Need 1 per signature 15 extra lines of code

So how does aspects solve that? Feel like you are missing something? 1 extra line of code

Demo time…

Under the hood IL modified Source: .NET Reflector 6.8

Many ways to implement AOP in .NET currently Popular: IL Weaving @ compile or JIT PostSharp & Mono.Cecil Less: Hooking into .NET profiler API Proxies

Hooking the profiler Disadvantages Poor performance Exceptionally complex Not designed for this Advantages Nothing is safe from it’s power Solves some fringe cases (i.e. mocking static methods) Application COM API Profiler CLR Environmental

Proxies Normal Proxied Method Call Method Call Object Proxy Disadvantages Complex with ContextBoundObject Perf is worse than IL weaving Advantages Using DI it can be easier Perf is better than .NET profiler Object

Future: Post Roslyn Theory Next version of C#/VB “compiler” Written in managed code Available as a service Post Roslyn Insert new language semantics Approach the AspectJ style

AOP Way to untangle cross cutting concerns out of business code Summary AOP Way to untangle cross cutting concerns out of business code Great re-use Can be easy to use (depending on implementation) Many options to do this!

Questions & Discussions