I'm developing a ClassLibrary with MVP architecture for create our internal 
applications easier.
I've added several interesting features and now, I wanted add it a 
centralized exception management with Dynamic Proxy:
I would like that for any exception in any view, any presenter or any 
service several actions are made: register exception in event 

viewer, send a mail to Help Desk, ... event show exception message to user 
could be also considered an action like these.
My question is, which option is best? (Or none? Buaaaaaa!)

A:
Create IErrorHandle interface with "Handle(Exception ex)" operation and an 
implementation for "action": event viewer, mail, 

messagebox, ...
Then, create A SINGLE INTERCEPTOR with a List<IErrorHandle>, and in 
Intercept method, simple code like this:
        Try
            invocation.Proceed()

            Return
        Catch ex As Exception
            For Each h In _errorHandlers
                h.Handle(ex, invocation)
            Next
        End Try

B:
Create ONE INTERCEPTOR PER ACTION: EventViewerInterceptor, MailInterceptor, 
MessageBoxInterceptor, ...
IErrorHandle would not be required.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/castle-project-users/-/cXqLyd9oL5EJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to