Aspect Oriented Programming in JavaScript - An Introduction to AOP

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ธ.ค. 2024

ความคิดเห็น • 16

  • @yolemmein
    @yolemmein 7 ปีที่แล้ว +5

    I've been using stuff like this even without knowing it was called AOP. Great explanation. Thanks!

  • @vadrif-draco
    @vadrif-draco ปีที่แล้ว

    Great examples, great explanation, great video. 10/10.

  • @anuragkhandelwal9703
    @anuragkhandelwal9703 5 ปีที่แล้ว +4

    is AOP something related to use of decorators ( @ ) ?

    • @LiveYourCode
      @LiveYourCode  4 ปีที่แล้ว +1

      AOP is a programming paradign - a "high level concept". Decorators (talking about the things that start with @, NOT about the design pattern) are a JavaScript feature and yes, with decorators you can implement lots of ideas coming from AOP. Decorators are still experimental for JavaScript while as what I explained in the video is "pure" and supported JavaScript / functional programming.
      Anyways, I pretty much fell in love with decorators since they are very easy to read, so today I'd probably code the same examples using decorators instead :)

  • @husnainajmal3346
    @husnainajmal3346 3 ปีที่แล้ว

    how exactly the last part is working. like the Last part where you are adding aspects

  • @DanielaBarrientos
    @DanielaBarrientos 5 ปีที่แล้ว +2

    So is separation of concerns a way of using AOP?

    • @LiveYourCode
      @LiveYourCode  4 ปีที่แล้ว +1

      Concepts coming from AOP help to separate concerns (as do concepts of OOP or functional programming). So separation of concern is the higher goal you want to achieve, and the concepts taken from AOP help us to reach that goal

  • @wobble_cat
    @wobble_cat 5 ปีที่แล้ว +2

    Can't see the difference between decorator/wrapper pattern and AOP

    • @somnathmahapatra6900
      @somnathmahapatra6900 4 ปีที่แล้ว +1

      decorators are used in resolving cross-cutting concerns which becomes a bit problematic to be used with regular inheritance ........so basically decorators address the cross-cutting concerns and hence different from wrappers

    • @LiveYourCode
      @LiveYourCode  4 ปีที่แล้ว

      I think you're referring to the decorator design pattern. This is a concept coming from OOP that helps dealing with adding functionality to existing classes without touching the class itself (extend instead of change). In contrast, the main goal of AOP is to write code where business logic functions/classes contain only business logic and no logic regarding cross-cutting-concerns like logging, authentication, caching, and so on.

  • @OleksaZelenyuk
    @OleksaZelenyuk 6 ปีที่แล้ว +2

    in terms of FP concepts it's called "currying" in it's simplest implementation

    • @dionbridger5944
      @dionbridger5944 3 ปีที่แล้ว +1

      Currying is something totally different, involving splitting a function of N arguments into a composition of N functions each of which is assigned a separate argument from the original function.

  • @alxrlja
    @alxrlja 4 ปีที่แล้ว +1

    This is an excellent video. I'm wondering why you are not making more and longer?

    • @LiveYourCode
      @LiveYourCode  4 ปีที่แล้ว

      Thanks! Anything you'd like me to elaborate in particular? Or just generally more AOP stuff?

  • @DanielRamBeats
    @DanielRamBeats 7 ปีที่แล้ว +1

    Gotta love closures!

  • @walt7868
    @walt7868 6 ปีที่แล้ว +1

    thanks