SlideShare a Scribd company logo
Introduction 
to AOP
Programming paradigm 
which aims to increase modularity 
by allowing the separation of 
cross-cutting concerns 
en.wikipedia.org/wiki/aspect-oriented-programming
Programming Paradigm 
It is *NOT* 
- a programming language 
- solution to all your problems 
- a first class citizen in Java 
or .NET 
- a replacement for OOP 
It is 
- a programming pattern 
- a tool in your toolbox 
- an easily added language 
feature 
- complimentary to OOP
Modularity 
Aspects can… 
• Exist in isolated and encapsulated constructs 
• Be attached to almost any standard code construct 
• Be transported between projects
Cross-Cutting Concerns 
…aspects of a program that affect other concerns. 
These concerns often cannot be cleanly decomposed 
from the rest of the system in both the design and 
implementation, 
and can result in either scattering (code duplication), 
tangling (significant dependencies between systems), 
or both. 
http://en.wikipedia.org/wiki/Cross-cutting_concern
…more simply 
Any code functionality that repeats itself in a regular 
pattern across many unrelated tiers/layers within a 
codebase.
Cross-Cutting Concerns 
View 
ViewModel 
Model 
Services 
Domain Model 
Repositories 
Logging 
Security 
Auditing 
Validation 
INotifyPropertyChanged 
Undo/Redo 
Thread Management 
Unit of Work Management 
Circuit Breaker
AOP Styles 
1. Interception 
Interjecting the execution of cross-cutting concerns at 
run time. 
Non-invasive approach to modifying the code execution 
path. 
2. IL Weaving 
Interjecting the planned execution of cross-cutting 
concerns during the compilation process. 
Invasive approach to modifying the code execution 
path.
Interception 
• Existing in IoC container implementations 
• Follows a very strict decorator pattern 
• Likely implemented using weak typing 
• Run-time operation 
• Can be applied en-masse 
• Easy to implement if you’re already using IoC
Decorator Pattern 
//new functionality before 
//the code that already exists 
//new functionality after 
//exception handling
Weak Typing
En-masse Attachment
IL Weaving 
• Post compilation process 
• Alters the assembly/executable at an IL level 
• Scary to people 
• Can be attached to almost every code construct 
• Very rare that it required changes to existing code 
• Run and compile time operations 
• Can be much easier to add to legacy code
The Process 
Write Code 
Compile 
Application exe/dll 
AOP post 
compiler/weaver 
Throw 
compile-time 
error 
Deploy exe/dll
Constructs 
• Methods (private/public/internal/etc) 
• Properties 
• Field level variables 
• Events 
• Event registration/de-registration 
• Code generation
Run Time vs Compile Time 
Run Time 
• All aspect code executes in application context 
Compile Time 
• Code can be designated to run during post-compilation 
• Compilation can fail for correct syntaxes but incorrect 
business logic
Tooling 
• Interception 
• Castle Winsdor 
• StructureMap 
• Ninject (with Ninject.Extensions) 
• AutoFac (with Autofac.Extras) 
• IL Weaving 
• PostSharp (current) 
• LinFu
The Traditional Arguments Against AOP 
• It is “magic” 
• We won’t be able to debug properly 
• How do we know where aspects will be executed? 
• It’s another thing we have to learn 
• Changing the aspect will break the entire application
“Its magic!” & “We can’t debug it!” 
• Both interception and IL weaving provide full line-by-line 
debugging 
• Attachment of aspects is explicit as you want it to be
“But which aspect(s) will run?” 
• This is a tooling/discoverability problem, not a problem with 
AOP itself 
• PostSharp has very good VS integration showing what aspects 
are attached to a piece of code 
• Interceptor discoverability is a bigger problem
“Its another thing we have to learn” 
Is it worse if we train them and 
they leave or if we don’t train 
them and they stay?
“Changing the aspect can break the 
entire application!” 
• You can probably do that in an number of different ways with 
any codebase that doesn’t use AOP 
• This is a problem caused by tight coupling and poor separation 
of concerns
Your Project is Already Established… 
You use IoC 
• For logging, caching and possibly transaction management use 
interception 
• If the cross cutting concerns are more complex (Undo/Redo, 
thread management) use IL Weaving 
You don’t use IoC 
• The only real option is to use IL Weaving
You’re Starting a New Project… 
You have AOP buy-in from senior developers 
• Start with IL Weaving, but start with simple, pre-built aspects 
• Write custom aspects as experience and need grows 
AOP is still unknown to the senior people on the team 
• Start with IL Weaving, but start in a very isolated manner 
• Use this as a proof of concept until you have senior level buy-in
gracias 
Donald Belcham 
@dbelcham 
donald.belcham@igloocoder.com

More Related Content

What's hot

La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!
Ulrich Krause
 
Key considerations for multithreaded architectures in LabVIEW
Key considerations for multithreaded architectures in LabVIEWKey considerations for multithreaded architectures in LabVIEW
Key considerations for multithreaded architectures in LabVIEW
Piotr Demski
 
PHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the codePHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the code
Michal Juhas
 
Power-Up Your Test Suite with OLE Automation by Joshua Russell
Power-Up Your Test Suite with OLE Automation by Joshua RussellPower-Up Your Test Suite with OLE Automation by Joshua Russell
Power-Up Your Test Suite with OLE Automation by Joshua Russell
QA or the Highway
 
Behaviour testing for single-page applications and API’s
Behaviour testing for single-page applications and API’sBehaviour testing for single-page applications and API’s
Behaviour testing for single-page applications and API’s
Andrew Kirkpatrick
 
Ten Advices for Architects
Ten Advices for ArchitectsTen Advices for Architects
Ten Advices for Architects
Eberhard Wolff
 
Accelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentAccelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol development
Micro Focus
 
Containerizing legacy applications
Containerizing legacy applicationsContainerizing legacy applications
Containerizing legacy applications
Andrew Kirkpatrick
 
Robot Framework with actual robot
Robot Framework with actual robot Robot Framework with actual robot
Robot Framework with actual robot
Eficode
 
Entity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and BeyondEntity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and Beyond
Steve Westgarth
 
Next Level Unit Testing - Javacro 2019 - Dominik Poljak
Next Level Unit Testing - Javacro 2019 - Dominik PoljakNext Level Unit Testing - Javacro 2019 - Dominik Poljak
Next Level Unit Testing - Javacro 2019 - Dominik Poljak
Dominik Poljak
 
Belfast Selenium Meetup
Belfast Selenium MeetupBelfast Selenium Meetup
Belfast Selenium Meetup
Justin Ison
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014
Justin Ison
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...seleniumconf
 
DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016
Justin Ison
 
Test-driven development with Node.js
Test-driven development with Node.jsTest-driven development with Node.js
Test-driven development with Node.js
Mirko Kiefer
 
Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
Wyn B. Van Devanter
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
Steven Smith
 
Zero redeployment with JRebel
Zero redeployment with JRebelZero redeployment with JRebel
Zero redeployment with JRebel
Minh Hoang
 

What's hot (20)

La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!La vita nella corsia di sorpasso; A tutta velocità, XPages!
La vita nella corsia di sorpasso; A tutta velocità, XPages!
 
Key considerations for multithreaded architectures in LabVIEW
Key considerations for multithreaded architectures in LabVIEWKey considerations for multithreaded architectures in LabVIEW
Key considerations for multithreaded architectures in LabVIEW
 
PHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the codePHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the code
 
Power-Up Your Test Suite with OLE Automation by Joshua Russell
Power-Up Your Test Suite with OLE Automation by Joshua RussellPower-Up Your Test Suite with OLE Automation by Joshua Russell
Power-Up Your Test Suite with OLE Automation by Joshua Russell
 
Behaviour testing for single-page applications and API’s
Behaviour testing for single-page applications and API’sBehaviour testing for single-page applications and API’s
Behaviour testing for single-page applications and API’s
 
Ten Advices for Architects
Ten Advices for ArchitectsTen Advices for Architects
Ten Advices for Architects
 
Accelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentAccelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol development
 
Containerizing legacy applications
Containerizing legacy applicationsContainerizing legacy applications
Containerizing legacy applications
 
Robot Framework with actual robot
Robot Framework with actual robot Robot Framework with actual robot
Robot Framework with actual robot
 
Entity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and BeyondEntity Framework: To the Unit of Work Design Pattern and Beyond
Entity Framework: To the Unit of Work Design Pattern and Beyond
 
QAorHighway2016
QAorHighway2016QAorHighway2016
QAorHighway2016
 
Next Level Unit Testing - Javacro 2019 - Dominik Poljak
Next Level Unit Testing - Javacro 2019 - Dominik PoljakNext Level Unit Testing - Javacro 2019 - Dominik Poljak
Next Level Unit Testing - Javacro 2019 - Dominik Poljak
 
Belfast Selenium Meetup
Belfast Selenium MeetupBelfast Selenium Meetup
Belfast Selenium Meetup
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
 
DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016DCAST Meetup - Washington, DC Feb 2016
DCAST Meetup - Washington, DC Feb 2016
 
Test-driven development with Node.js
Test-driven development with Node.jsTest-driven development with Node.js
Test-driven development with Node.js
 
Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
Zero redeployment with JRebel
Zero redeployment with JRebelZero redeployment with JRebel
Zero redeployment with JRebel
 

Viewers also liked

Summary of Aspect Oriented Programming
Summary of Aspect Oriented ProgrammingSummary of Aspect Oriented Programming
Summary of Aspect Oriented Programming
Michael Jo
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
Shreya Chatterjee
 
AspectJ Android with Example
AspectJ Android with ExampleAspectJ Android with Example
AspectJ Android with Example
firstthumb
 
AOP
AOPAOP
ASPECT ORIENTED PROGRAMING(aop)
ASPECT ORIENTED PROGRAMING(aop)ASPECT ORIENTED PROGRAMING(aop)
ASPECT ORIENTED PROGRAMING(aop)
kvsrteja
 
Aspect Oriented Software Development
Aspect Oriented Software DevelopmentAspect Oriented Software Development
Aspect Oriented Software DevelopmentJignesh Patel
 

Viewers also liked (6)

Summary of Aspect Oriented Programming
Summary of Aspect Oriented ProgrammingSummary of Aspect Oriented Programming
Summary of Aspect Oriented Programming
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
 
AspectJ Android with Example
AspectJ Android with ExampleAspectJ Android with Example
AspectJ Android with Example
 
AOP
AOPAOP
AOP
 
ASPECT ORIENTED PROGRAMING(aop)
ASPECT ORIENTED PROGRAMING(aop)ASPECT ORIENTED PROGRAMING(aop)
ASPECT ORIENTED PROGRAMING(aop)
 
Aspect Oriented Software Development
Aspect Oriented Software DevelopmentAspect Oriented Software Development
Aspect Oriented Software Development
 

Similar to Introduction to Aspect Oriented Programming by Donald Belcham

10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
mfrancis
 
Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)
Yan Cui
 
The Architect Way
The Architect WayThe Architect Way
The Architect Way
Jan Jongboom
 
Orthogonality: A Strategy for Reusable Code
Orthogonality: A Strategy for Reusable CodeOrthogonality: A Strategy for Reusable Code
Orthogonality: A Strategy for Reusable Codersebbe
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET Dmytro Mindra
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVC
Ulrich Krause
 
JAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptJAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).ppt
AliyaJav
 
An Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPagesAn Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPages
Ulrich Krause
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
Jonas Brømsø
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
Julien Dubois
 
Introduction to Spring & Spring BootFramework
Introduction to Spring  & Spring BootFrameworkIntroduction to Spring  & Spring BootFramework
Introduction to Spring & Spring BootFramework
Kongu Engineering College, Perundurai, Erode
 
Stackato
StackatoStackato
Stackato
Jonas Brømsø
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
Johan Edstrom
 
Features of Java.pptx
Features of Java.pptxFeatures of Java.pptx
Features of Java.pptx
Peter Jose
 
Starting from scratch in 2017
Starting from scratch in 2017Starting from scratch in 2017
Starting from scratch in 2017
Stefano Bonetta
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
prakashk453625
 
Java training in bangalore
Java training in bangaloreJava training in bangalore
Java training in bangalore
zasi besant
 
Survive the Chaos - S4H151 - SAP TechED Barcelona 2017 - Lecture
Survive the Chaos - S4H151 - SAP TechED Barcelona 2017 - LectureSurvive the Chaos - S4H151 - SAP TechED Barcelona 2017 - Lecture
Survive the Chaos - S4H151 - SAP TechED Barcelona 2017 - Lecture
Rainer Winkler
 
Javascript best practices
Javascript best practicesJavascript best practices
Javascript best practices
Jayanga V. Liyanage
 
Intro to Microsoft.NET
Intro to Microsoft.NET Intro to Microsoft.NET
Intro to Microsoft.NET rchakra
 

Similar to Introduction to Aspect Oriented Programming by Donald Belcham (20)

10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
 
Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)
 
The Architect Way
The Architect WayThe Architect Way
The Architect Way
 
Orthogonality: A Strategy for Reusable Code
Orthogonality: A Strategy for Reusable CodeOrthogonality: A Strategy for Reusable Code
Orthogonality: A Strategy for Reusable Code
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVC
 
JAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptJAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).ppt
 
An Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPagesAn Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPages
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
Introduction to Spring & Spring BootFramework
Introduction to Spring  & Spring BootFrameworkIntroduction to Spring  & Spring BootFramework
Introduction to Spring & Spring BootFramework
 
Stackato
StackatoStackato
Stackato
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
 
Features of Java.pptx
Features of Java.pptxFeatures of Java.pptx
Features of Java.pptx
 
Starting from scratch in 2017
Starting from scratch in 2017Starting from scratch in 2017
Starting from scratch in 2017
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
 
Java training in bangalore
Java training in bangaloreJava training in bangalore
Java training in bangalore
 
Survive the Chaos - S4H151 - SAP TechED Barcelona 2017 - Lecture
Survive the Chaos - S4H151 - SAP TechED Barcelona 2017 - LectureSurvive the Chaos - S4H151 - SAP TechED Barcelona 2017 - Lecture
Survive the Chaos - S4H151 - SAP TechED Barcelona 2017 - Lecture
 
Javascript best practices
Javascript best practicesJavascript best practices
Javascript best practices
 
Intro to Microsoft.NET
Intro to Microsoft.NET Intro to Microsoft.NET
Intro to Microsoft.NET
 

More from .NET Conf UY

Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
Roslyn: el futuro de C# y VB.NET by Rodolfo FinochiettiRoslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
.NET Conf UY
 
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
.NET Conf UY
 
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel AppelBuilding Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
.NET Conf UY
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel
.NET Conf UY
 
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
.NET Conf UY
 
Windows y .NET en la Internet of Things by Pablo Garcia
Windows y .NET en la Internet of Things by Pablo GarciaWindows y .NET en la Internet of Things by Pablo Garcia
Windows y .NET en la Internet of Things by Pablo Garcia
.NET Conf UY
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
.NET Conf UY
 
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
.NET Conf UY
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
.NET Conf UY
 
Emprendiendo un futuro by Gabriel Camargo
Emprendiendo un futuro by Gabriel CamargoEmprendiendo un futuro by Gabriel Camargo
Emprendiendo un futuro by Gabriel Camargo
.NET Conf UY
 
Microsoft Platform Vision by Eduardo Mangarelli
Microsoft Platform Vision by Eduardo MangarelliMicrosoft Platform Vision by Eduardo Mangarelli
Microsoft Platform Vision by Eduardo Mangarelli
.NET Conf UY
 
Arquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
Arquitectura para Windows Azure: Pienso, luego existo by Fernando MachadoArquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
Arquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
.NET Conf UY
 
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
.NET Conf UY
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
.NET Conf UY
 
Opportunities to Improve System Reliability and Resilience by Donald Belcham
Opportunities to Improve System Reliability and Resilience by Donald BelchamOpportunities to Improve System Reliability and Resilience by Donald Belcham
Opportunities to Improve System Reliability and Resilience by Donald Belcham
.NET Conf UY
 
RESTful Para todos by Diego Sapriza
RESTful Para todos by Diego SaprizaRESTful Para todos by Diego Sapriza
RESTful Para todos by Diego Sapriza
.NET Conf UY
 
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan FernandezFun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
.NET Conf UY
 
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
.NET Conf UY
 

More from .NET Conf UY (18)

Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
Roslyn: el futuro de C# y VB.NET by Rodolfo FinochiettiRoslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
 
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
 
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel AppelBuilding Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel
 
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
I just met you, and "this" is crazy, but here's my NaN, so call(me), maybe? b...
 
Windows y .NET en la Internet of Things by Pablo Garcia
Windows y .NET en la Internet of Things by Pablo GarciaWindows y .NET en la Internet of Things by Pablo Garcia
Windows y .NET en la Internet of Things by Pablo Garcia
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
 
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
Metodologías ¿Ágiles o productivas? Una visión desde la trinchera by Marcos E...
 
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
Tips & tricks for sharing C# code on iOS, Android and Windows Phone by Jaime ...
 
Emprendiendo un futuro by Gabriel Camargo
Emprendiendo un futuro by Gabriel CamargoEmprendiendo un futuro by Gabriel Camargo
Emprendiendo un futuro by Gabriel Camargo
 
Microsoft Platform Vision by Eduardo Mangarelli
Microsoft Platform Vision by Eduardo MangarelliMicrosoft Platform Vision by Eduardo Mangarelli
Microsoft Platform Vision by Eduardo Mangarelli
 
Arquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
Arquitectura para Windows Azure: Pienso, luego existo by Fernando MachadoArquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
Arquitectura para Windows Azure: Pienso, luego existo by Fernando Machado
 
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
Extendiendo SharePoint, Project y Office 2013 con el nuevo modelo de Apps by ...
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
 
Opportunities to Improve System Reliability and Resilience by Donald Belcham
Opportunities to Improve System Reliability and Resilience by Donald BelchamOpportunities to Improve System Reliability and Resilience by Donald Belcham
Opportunities to Improve System Reliability and Resilience by Donald Belcham
 
RESTful Para todos by Diego Sapriza
RESTful Para todos by Diego SaprizaRESTful Para todos by Diego Sapriza
RESTful Para todos by Diego Sapriza
 
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan FernandezFun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure by Dan Fernandez
 
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
Azure: un parque de diversiones en la nube para el desarrollador moderno by A...
 

Recently uploaded

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 

Recently uploaded (20)

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 

Introduction to Aspect Oriented Programming by Donald Belcham

  • 2. Programming paradigm which aims to increase modularity by allowing the separation of cross-cutting concerns en.wikipedia.org/wiki/aspect-oriented-programming
  • 3. Programming Paradigm It is *NOT* - a programming language - solution to all your problems - a first class citizen in Java or .NET - a replacement for OOP It is - a programming pattern - a tool in your toolbox - an easily added language feature - complimentary to OOP
  • 4. Modularity Aspects can… • Exist in isolated and encapsulated constructs • Be attached to almost any standard code construct • Be transported between projects
  • 5. Cross-Cutting Concerns …aspects of a program that affect other concerns. These concerns often cannot be cleanly decomposed from the rest of the system in both the design and implementation, and can result in either scattering (code duplication), tangling (significant dependencies between systems), or both. http://en.wikipedia.org/wiki/Cross-cutting_concern
  • 6. …more simply Any code functionality that repeats itself in a regular pattern across many unrelated tiers/layers within a codebase.
  • 7.
  • 8. Cross-Cutting Concerns View ViewModel Model Services Domain Model Repositories Logging Security Auditing Validation INotifyPropertyChanged Undo/Redo Thread Management Unit of Work Management Circuit Breaker
  • 9. AOP Styles 1. Interception Interjecting the execution of cross-cutting concerns at run time. Non-invasive approach to modifying the code execution path. 2. IL Weaving Interjecting the planned execution of cross-cutting concerns during the compilation process. Invasive approach to modifying the code execution path.
  • 10. Interception • Existing in IoC container implementations • Follows a very strict decorator pattern • Likely implemented using weak typing • Run-time operation • Can be applied en-masse • Easy to implement if you’re already using IoC
  • 11. Decorator Pattern //new functionality before //the code that already exists //new functionality after //exception handling
  • 14. IL Weaving • Post compilation process • Alters the assembly/executable at an IL level • Scary to people • Can be attached to almost every code construct • Very rare that it required changes to existing code • Run and compile time operations • Can be much easier to add to legacy code
  • 15. The Process Write Code Compile Application exe/dll AOP post compiler/weaver Throw compile-time error Deploy exe/dll
  • 16. Constructs • Methods (private/public/internal/etc) • Properties • Field level variables • Events • Event registration/de-registration • Code generation
  • 17. Run Time vs Compile Time Run Time • All aspect code executes in application context Compile Time • Code can be designated to run during post-compilation • Compilation can fail for correct syntaxes but incorrect business logic
  • 18. Tooling • Interception • Castle Winsdor • StructureMap • Ninject (with Ninject.Extensions) • AutoFac (with Autofac.Extras) • IL Weaving • PostSharp (current) • LinFu
  • 19. The Traditional Arguments Against AOP • It is “magic” • We won’t be able to debug properly • How do we know where aspects will be executed? • It’s another thing we have to learn • Changing the aspect will break the entire application
  • 20. “Its magic!” & “We can’t debug it!” • Both interception and IL weaving provide full line-by-line debugging • Attachment of aspects is explicit as you want it to be
  • 21. “But which aspect(s) will run?” • This is a tooling/discoverability problem, not a problem with AOP itself • PostSharp has very good VS integration showing what aspects are attached to a piece of code • Interceptor discoverability is a bigger problem
  • 22. “Its another thing we have to learn” Is it worse if we train them and they leave or if we don’t train them and they stay?
  • 23. “Changing the aspect can break the entire application!” • You can probably do that in an number of different ways with any codebase that doesn’t use AOP • This is a problem caused by tight coupling and poor separation of concerns
  • 24. Your Project is Already Established… You use IoC • For logging, caching and possibly transaction management use interception • If the cross cutting concerns are more complex (Undo/Redo, thread management) use IL Weaving You don’t use IoC • The only real option is to use IL Weaving
  • 25. You’re Starting a New Project… You have AOP buy-in from senior developers • Start with IL Weaving, but start with simple, pre-built aspects • Write custom aspects as experience and need grows AOP is still unknown to the senior people on the team • Start with IL Weaving, but start in a very isolated manner • Use this as a proof of concept until you have senior level buy-in
  • 26. gracias Donald Belcham @dbelcham donald.belcham@igloocoder.com