On Mar 23, 2006, at 3:34 PM, Ken Dunnington wrote:
I am implementing a simple logging aspect for my app, and right now I only need to log two events, but they're on different objects and I need to perform different actions depeding on the objects I'm advising. So my first question is, should I set the mappedNames to * and perform logic inside the advisor to do what I need, doing nothing on the other methods, or should I explicitly specify the methods in the config file?
Hmm. First off, I would narrow down the advisor to the methods that you actually want to log. Also I would try to make that logging aspect as generic as possible. If you have vastly different functionality that you want to preform, I would consider different aspects, but one thing that I like to think about is trying to program my aspects in the most generalized fashion as possible and get them to behave in a more specialized manor by the way they are configured. A shift in thinking I suppose.
Second question is about the klondike sample app. The logging advice there is around advice, and I was wondering what the criteria was for deciding to do this kind of advice versus after advice, which seems like a good place to put logging to me. I don't intend on modifying the method at all, and after advice seems a bit easier to get my head around, so would you recommend going with that for now?
There's no particular good reason why I implemented the logging advice as around advice for the klonike app. The only thing I can say is I use it as a test bed. When I make changes, I run all my unit tests, and then see if a few different apps run, then ask some others to do the same. SO I guess I just wanted some different advice types in there.
Sorry, didn't answer your question at all! Ok, so I would always use the LEAST powerful type of advice as needed. So if you don't have any reason to alter the method call, why take on the responsibility of actually controlling the method call? Hope that helps. Also sorry I didn;t get back to you yesterday. Man I fell asleep at 9:00 last night! cfObjective finally caught up to me!
-Chris Chris Scott [EMAIL PROTECTED] http://cdscott.blogspot.com/ http://www.coldspringframework.org/

