13 Replies Latest reply: Oct 25, 2007 6:42 PM by 807592 RSS

    OOP Vs AOP

    807587
      I like to know all the advantages and disadvantages of AOP (Aspect Oriented Programming) against OOP (Object Oriented Programming) methodologies.

      When to use AOP and also Its benefits in real world application development ? need a practical example how AOP dynamically modifies the model ? need a sample program which explains aop in a better way ?

      What pattern AOP follows ?
        • 1. Re: OOP Vs AOP
          807587
          check out
          http://www.onjava.com/pub/a/onjava/2004/01/14/aop.html
          • 2. Re: OOP Vs AOP
            807587
            What you really need, methinks, is google.
            • 3. Re: OOP Vs AOP
              807587
              I agree that you should hit google for this - but just to throw my 2 cents in - OOP and AOP aren't really an either/or deal. AOP is not really OO, but that's kinda the point - it's meant to address parts of a design that, by their very nature, aren't OO. Crosscutting concerns, like, say, logging, would require code to be sprinkled all over your codebase without AOP, which isn't very OO. But with AOP the logging code is only in one place (source-code wise).

              Good Luck

              Lee
              • 4. Re: OOP Vs AOP
                807587
                But with AOP the
                logging code is only in one place (source-code
                wise).
                How so? What is the difference between logging in OOP and logging in AOP? In my world, you grab the reference to the logger and write out data. So, how much simpler can this be? Please explain.
                • 5. Re: OOP Vs AOP
                  800382
                  what about OPP?
                  • 6. Re: OOP Vs AOP
                    807587
                    what about OPP?
                    I'm just not down with that.
                    • 7. Re: OOP Vs AOP
                      807587
                      You know what OPP stands for?


                      Illiterate Rap Stars.
                      • 8. Re: OOP Vs AOP
                        807587
                        But with AOP the
                        logging code is only in one place (source-code
                        wise).
                        How so? What is the difference between logging in OOP
                        and logging in AOP? In my world, you grab the
                        reference to the logger and write out data. So, how
                        much simpler can this be? Please explain.
                        Everytime you want to log something anywhere in your application you will at least have one line - LogManager.logThis(someObject) - (or something like that). This is all over your codebase. In AOP you have an aspect that then gets woven (if you will) per some pointcut definition, into your compiled code. So, from a source-code perspective, it's only in one place.

                        Make sense?

                        Good Luck

                        Lee

                        http://www-128.ibm.com/developerworks/rational/library/2782.html
                        • 9. Re: OOP Vs AOP
                          807587
                          You know what OPP stands for?


                          Illiterate Rap Stars.
                          You know me.
                          • 10. Re: OOP Vs AOP
                            807592
                            what is the difference between oop and aop ?
                            • 11. Re: OOP Vs AOP
                              jwenting
                              one third of a TLA.
                              • 12. Re: OOP Vs AOP
                                796440
                                kaatiboyeena wrote:
                                what is the difference between oop and aop ?
                                Which articles from your google query did you read and what didn't you understand about them?

                                I mean, surely you're not such a lazy twat that you're asking others to digest and regurgitate them for you, right?
                                • 13. Re: OOP Vs AOP
                                  807592
                                  OOP is more real-world--its like using physical objects that you can manipulate etc. Its more user friendly in most cases.
                                  Thats about all I know. which isnt much. but i will get there lol.