Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is AOP a type of decorator pattern?

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 ?

like image 796
Vinoth Kumar C M Avatar asked Nov 13 '11 14:11

Vinoth Kumar C M


1 Answers

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

like image 157
Yahia Avatar answered Oct 05 '22 21:10

Yahia