On 11/19/05, Peter J. Farrell <[EMAIL PROTECTED]> wrote: > Also, can't wait to play with the AOP stuff. I'm expect to be working on a > project that will require logging who accesses certain data in the database > -- sounds like I could create a logging service to check who's looking at > what. Is that correct? (My knowledge of AOP is limited to the blog posts > by Chris Scott and Wikipedia).
Create a LoggingService because you need to do logging, but it won't have anything to do with AOP (chances are you'll have an area of your app where you'll do "traditional logging" meaning the LoggingService is injected into one of you model components and is used to "log stuff"). The LoggingService is part of your model. Then you would create a LoggingAspect, and inject your logging service into the LoggingAspect just as you did into other model components. The Aspect is called by the AOP framework when the "pointcuts" occur (e.g. before this method, after this method, etc), and the Aspect will use the LoggingService to log what happened. I think Sean is going to blog about Aspects and where they fit in your model, and what I just described is what I consider "best practice", meaning that, when possible, your Aspects use your Model components to get their jobs done, and don't contain much business logic themselves (this isn't a 100% rule... it really depends on what you are gonna use AOP for). > P.s. Dave, nice website for CS! Thanks! (Chris did the colors/banner/logo... not only is he incredibly talented at programming, he also is a seasoned graphic design veteran!).
