Is AOP a type of decorator pattern

aopdecoratordesign-patternslanguage-agnostic

I got asked this question in a interview. I clearly know what a decorator pattern is and how it can be used. But I was not able to think through this question in the interview.

This is the actual question asked.

Is AOP a variation of decorator pattern ? How does the AOP implementation vary from trademark decorator pattern ?

Best Answer

I would say AOP (Aspect Oriented Programming) is NOT a pattern by itself (and thus not a type of decorator pattern from my POV)... its implementation can be done via one or more patterns (including the use of decorator pattern)... AOP is a programming paradigm IMHO - other paradigms are for example OOP, functional programming or procedural programming...