5

Background

I am trying to implement logging and exception handling using AOP for a new project. I wish to apply this through all the 3 layers of a Windows form application. I am using Windsor Castle as the container.

I have successfully applied logging through AOP to a very simple example. But scaling it to a winforms application is proving difficult.

Problem

I managed to register the main form in the container and apply the logging aspect as well. But the aspect is being hit for all events w.r.t winforms. (eg: get_ForeColor, get_BackColor, OnControlAdded, DefWndProc, DestroyHandle..etc)

The events and methods that i actually need logging for are not showing up in the log file(aspect). What am i doing wrong here. Is an interface implementation always necessary for AOP?

I would also like to know what the framework (or architecture) should look like with AOP. How and where should the registration of all components from 3 layers take place. Should it be at application start up? Links to any examples will be very helpful.

PS: This is the first time i am trying to implement AOP. To add to it i have to code in vb.net which i am not very comfortable with. Also i cannot use Post Sharp (funds are an issue).

nikhil pinto
  • 331
  • 1
  • 4
  • 15

0 Answers0