Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Refactoring With Aspect Oriented Programming

Mert Metin
November 19, 2022

Refactoring With Aspect Oriented Programming

Refactoring With Aspect Oriented Programming

Devnot - Hello Talks
Zemin İstanbul / İstanbul

Mert Metin

November 19, 2022

More Decks by Mert Metin

Other Decks in Programming


  1. Blog - https://mertmtn.blogspot.com/ 1 Github - https://github.com/mertmtn 2 LinkedIn -

    https://www.linkedin.com/in/mrtmtn/ 3 Twitter - https://twitter.com/_mertmetin 4 About Me Mert Metin Software Engineer @Sompo Sigorta MSc. in Information Technologies @Yildiz Technical University
  2. Agenda What is AOP? 1 Some AOP Terminogies 2 Benefits

    of AOP 6 Sample Codes 5 Refactoring 4 Interceptors 3
  3. AOP is an approach that separates functional and common non

    functional codes. Functional codes perform main business logic of an application. Non functional codes are cross cutting concerns which can be used everywhere or every layer are meaningful as an individual module. In other words; increases modularity by allowing the separation of cross-cutting concerns. What is AOP - Aspect Oriented Programming
  4. Some AOP Terminologies Cross Cutting Concern Aspects of a program

    that affect other concerns. E.g. Validation, Logging, Caching, Exception, etc. Join point A candidate point in the program execution where an aspect can be plugged in. E.g. OnBefore, OnAfter, OnSuccess, OnException Pointcut Which method does executes on join point? E.g: Logging Method Aspect Implemented the concern as programmatically e.g: ValidationAspect, ExceptionAspect Advice Additional logic or code called from a join point.
  5. .NET: Postsharp-Autofac Java: Spring-AspectJ-JBoss PHP: Go AOP If you would

    like to add extra functionality when method execution any where, you need interceptors. They allow inject logic on before, after, exception, success the method execution. Most frequently uses by languages/frameworks Interceptors
  6. A systematic process of improving code without creating new functionality

    that can transform a mess into clean code and simple design. Refactoring
  7. Benefits of AOP Reusability Single Responsibility Principle (SRP) Do Not

    Repeat Yourself (DRY) Separation of Concerns Adhering to important software principles. Maintability Modularity Readability