Aspect-Oriented Programming and JBoss
Subject:   Production
Date:   2003-05-30 09:26:43
From:   anonymous2
Response to: Logging and tracing code

Just to emphasize one of Bill's points.

A lot of the aspects we have are proven
PRODUCTION implementations from our EJB container.

Whether AOP applies to non-system aspects
is another question.
System aspects deal mainly with context
rather than data.

Bill mentioned billing.
Constraint validation would be another,
a sort of business level "assert".
Letting the POJO get on with the job of doing
rather than deciding whether it should.

You can build your own OOP framework for this,
AOP is much more flexible. It handles
the plumbing for you.
But it may be too flexible if you have lost
static type checking.


Full Threads Newest First

Showing messages 1 through 5 of 5.

  • Production
    2003-05-30 09:40:03  anonymous2 [View]

    Another example is hooks for notifications. No more of the syntax-sugar of Listener interfaces and such.

    • Production
      2003-05-30 12:00:15  anonymous2 [View]

      It's funny you should mention this because I am a big fan of the Dependency pattern. When you make use of it on a large scale it becomes critical to be able to control who publishes what and when, and what listeners do in response. Otherwise the notifications trigger listeners, which trigger more notifications which trigger more listeners and eventually it spins out of control.

      What I found when I used the Dependency mechanism on a large scale project was that I inititally wanted some sort of aspect mechanism (AOP wasn't around at the time). But that later, during debugging, I was thankful that I could adress the listener/notification issues on a case-by-case basis by inspecting the code.

      I also kept the number of central broadcasters to a minimum. If I were to add notification to every method of every class I wouldn't have a good grasp of which notification was the RIGHT notification to listen to.

      I understand how these issues are addressed when I am writing the code in a standard imperative manner. How are these addressed by AOP?
      • Production
        2003-05-30 13:33:15  patriot1burke [View]

        You haven't clearly defined your requirements here. Can you elaborate?

        There is a bunch of ways you could implement this pattern.

        1) Add a interceptor that broadcasts a generic message "notify(className, methodName, args, response);" and attached via a pointcut

        2) Add an interceptor per notification type which is attached via a separate pointcut for each notification type.

        3) Use our AOP runtime interface and have subscribers register specifically for notifications on a per instance basis.

        With JBoss AOP, you can apply interceptors solely to one specific object instance at runtime. So subscribers can register themselves in the traditional Listener manner, but Publishers don't have to be architected ahead of time to be publishers.

        • Production
          2003-05-31 09:36:55  anonymous2 [View]

          Is there a manual you can point to?
          • Production
            2003-06-02 05:56:35  warjort [View]

            There is html documentation included in the