SlideShare uma empresa Scribd logo
1 de 26
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

Mais conteúdo relacionado

Mais procurados

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 LabVIEWPiotr 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 codeMichal 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 RussellQA 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’sAndrew Kirkpatrick
 
Ten Advices for Architects
Ten Advices for ArchitectsTen Advices for Architects
Ten Advices for ArchitectsEberhard 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 developmentMicro Focus
 
Containerizing legacy applications
Containerizing legacy applicationsContainerizing legacy applications
Containerizing legacy applicationsAndrew 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 BeyondSteve 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 PoljakDominik Poljak
 
Belfast Selenium Meetup
Belfast Selenium MeetupBelfast Selenium Meetup
Belfast Selenium MeetupJustin Ison
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Justin 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 2016Justin Ison
 
Test-driven development with Node.js
Test-driven development with Node.jsTest-driven development with Node.js
Test-driven development with Node.jsMirko Kiefer
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
Zero redeployment with JRebel
Zero redeployment with JRebelZero redeployment with JRebel
Zero redeployment with JRebelMinh Hoang
 

Mais procurados (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
 

Destaque

Summary of Aspect Oriented Programming
Summary of Aspect Oriented ProgrammingSummary of Aspect Oriented Programming
Summary of Aspect Oriented ProgrammingMichael Jo
 
AspectJ Android with Example
AspectJ Android with ExampleAspectJ Android with Example
AspectJ Android with Examplefirstthumb
 
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
 

Destaque (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
 

Semelhante a 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 Molieremfrancis
 
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
 
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 MVCUlrich Krause
 
JAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptJAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptAliyaJav
 
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 XPagesUlrich Krause
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applicationsJulien Dubois
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stackJohan Edstrom
 
Features of Java.pptx
Features of Java.pptxFeatures of Java.pptx
Features of Java.pptxPeter Jose
 
Starting from scratch in 2017
Starting from scratch in 2017Starting from scratch in 2017
Starting from scratch in 2017Stefano Bonetta
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologiesprakashk453625
 
Java training in bangalore
Java training in bangaloreJava training in bangalore
Java training in bangalorezasi 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 - LectureRainer Winkler
 
Intro to Microsoft.NET
Intro to Microsoft.NET Intro to Microsoft.NET
Intro to Microsoft.NET rchakra
 

Semelhante a 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
 

Mais de .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
 

Mais de .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...
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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