Announcement Announcement Module
Collapse
No announcement yet.
Will AOP decrease the performance in my case? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Will AOP decrease the performance in my case?

    Hallo,

    i am new to AOP and am thinking of the possible application in one of our projects. Here is my Problem:

    I have a "order processing" Hibernate DAO object, which pumps huge amount of data on the daily basis. Very large amount of data, think of site like Amazon.

    Now, i need statistical data about orders collected in other DB Table. The problem is, saving Orders occurs everywhere. So, yes, i can call additional save after every orderDAO.save, but it is error-prone, means large manual work and just not elegant.

    The simple way of calling my logging save from the orderDAO.save is not an option. It will change the save signature and go against the Architecture of the Product, which says one "DAO handles one Entity and one DB table".

    So, i thought of using an Aspect here, which can be called each time the save occures.

    Questions:
    - is AOP suited for such a task?
    - will it mean significant performance decrease?
    - is there any other 'classic' way to solve such problem in large Web projects, without perfomance problems and without chainging too many code fragments?

    Any Ideas Greatly Appreciated
    regards // Neokrates

  • #2
    Maybe you can check this page to see how much Spring AOP will affect your system: http://docs.codehaus.org/display/AW/AOP+Benchmark

    You will find other way to add AOP (AspectJ, etc). The number are in nanoseconds. For example, a Spring (Proxy-AOP 1.1.1) before advice takes 225 nanoseconds.

    Comment


    • #3
      You could also use Hibernate Interceptors for this purpose.

      Comment


      • #4
        Ok, its impact should be negligible in the comparison to the interaction with the DB. You as well may save some time by using "real" (i. e. not proxy-based) AOP, e.g. by using AspectJ LTW (it is fairly well documented in the Spring Reference, chapter 6).

        BTW, if you use Spring declarative transaction management, then you use AOP anyway

        And one more remark - "DAO handles one Entity and one DB table" is (seriously) flawed architecture decision anyway.

        Regards,
        Oleksandr

        Originally posted by neokrates View Post
        Hallo,

        i am new to AOP and am thinking of the possible application in one of our projects. Here is my Problem:

        I have a "order processing" Hibernate DAO object, which pumps huge amount of data on the daily basis. Very large amount of data, think of site like Amazon.

        Now, i need statistical data about orders collected in other DB Table. The problem is, saving Orders occurs everywhere. So, yes, i can call additional save after every orderDAO.save, but it is error-prone, means large manual work and just not elegant.

        The simple way of calling my logging save from the orderDAO.save is not an option. It will change the save signature and go against the Architecture of the Product, which says one "DAO handles one Entity and one DB table".

        So, i thought of using an Aspect here, which can be called each time the save occures.

        Questions:
        - is AOP suited for such a task?
        - will it mean significant performance decrease?
        - is there any other 'classic' way to solve such problem in large Web projects, without perfomance problems and without chainging too many code fragments?

        Any Ideas Greatly Appreciated
        regards // Neokrates

        Comment


        • #5
          Originally posted by etienno View Post
          Maybe you can check this page to see how much Spring AOP will affect your system: http://docs.codehaus.org/display/AW/AOP+Benchmark

          You will find other way to add AOP (AspectJ, etc). The number are in nanoseconds. For example, a Spring (Proxy-AOP 1.1.1) before advice takes 225 nanoseconds.
          That bench mark is almost six years old now. Is there any new bench mark? I don't think so these results are now valid.

          Comment

          Working...
          X