C
Chris Fink
I have a the requirement for a class to alert via an email message when an
error occurs. In this main class, I have wrapped the main logic into a try
catch statement. When an error occurs, inside of the catch statement a call
to an alert class is invoked which in turn sends an email with the error
message. What would be the preferred design approach to solve this
requirement? My original thought is to create an interface for the
AlertAgent which will contain an Alert method. The main class would then
implement this interface, requiring an Alert method. It would then be the
programmers job to implement the logic inside of this method to invoke the
AlertAgent's send method.
Is this the correct approach? Suggestion, please.
Thanks
error occurs. In this main class, I have wrapped the main logic into a try
catch statement. When an error occurs, inside of the catch statement a call
to an alert class is invoked which in turn sends an email with the error
message. What would be the preferred design approach to solve this
requirement? My original thought is to create an interface for the
AlertAgent which will contain an Alert method. The main class would then
implement this interface, requiring an Alert method. It would then be the
programmers job to implement the logic inside of this method to invoke the
AlertAgent's send method.
Is this the correct approach? Suggestion, please.
Thanks