Edmund would make great use for logging as you don't want the user to be effected by the logging function. I'm not too familiar with AOP, but I generally stick with Edmund or some other event based system when I am running interactions that don't involve the user (logging, tracking and interacting with other systems).
sent from my Android smart phone
--
You received this message because you are subscribed to the Google Groups "edmund-coldfusion" group.
To post to this group, send email to edmund-c...@googlegroups.com.
To unsubscribe from this group, send email to edmund-coldfus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/edmund-coldfusion?hl=en.
Whilst logging is often held up as the poster child for AOP, I'm not
really convinced it's the best solution because it's a dumb, automatic
solution. In other words, if you just want to log function calls, AOP
is fine. If you actually want to log specific operations, AOP is just
not "smart enough" to do that.
I've dabbled with AOP a few times for supposedly "good fit" scenarios
but have almost always backed off and used a different approach
because AOP isn't flexible enough.
YMMV.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)
Whilst logging is often held up as the poster child for AOP, I'm not
really convinced it's the best solution because it's a dumb, automatic
solution. In other words, if you just want to log function calls, AOP
is fine. If you actually want to log specific operations, AOP is just
not "smart enough" to do that.
Right, the "advice" you want to run here is very specific to the use
case - very specific to the business logic - so it isn't really a
cross-cutting concern at all and it would be much clearer in your code
to explicitly call the logging method from the product addition
method. Using AOP, you have your business logic (add the product and
log it for an audit trail) in two completely separate places, wired
together "automagically" by some outside agent.
With the event-driven approach, you would at least see some event
being fired from the "add product" point and it would (or should!) be
easy to see the full set of listeners that will respond to it. Caveat:
that supposes you follow reasonable patterns in your event-driven
architecture - I've seen horrendous hub'n'spoke event-driven messes
where a central piece of code fires all the events and the listeners
are scattered all over the place. That is just as bad as AOP :)
Does that help?