Announcement Announcement Module
No announcement yet.
Best approach for building Rolling engine. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best approach for building Rolling engine.


    I need to add a rolling engine to my project.
    Whenever the server is building some particular object and save/update it there are number of business roles that needs to occur. For example, sending async message, sending mail, register jobs (using quartz) and extra.
    There are business roles that need to be transactions aware with each other and could be some business roles that donít have to be transactions aware.
    I thought to implement it using the observer pattern.
    I ask for yours thoughts how should I do with spring.
    Maybe using AOP?

  • #2
    Do you mean business rules? (Not roles?)

    AOP would be a good approach. If you are using Hiberbate, you could use Hibernate Interceptors for this purpose.


    • #3
      10xs mviswanathan,
      I meant rules..

      I also thought of using Hibernate eventing system, for listen for events such as inserts and updates and define event listener classes to respond to those events.
      Which approach is better, the AOP or using Hibernate infrastructure.
      What are the pros and cons of each approach.


      • #4
        Hibernate Interceptors also work on principles of AOP. I guess you mean something like AspectJ when you say AOP?

        If your requirement is intercepting save/update of domain objects only, Hibernate Interceptors will do the job. AspectJ is quite powerful, can be too much for what you need.