Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is this pattern?

I have a few classes that perform background tasks that might raise exceptions. They all implement the following interface:

public interface HowDoYouCallMe {
    void addExceptionHandler(ExceptionHandler handler);
}

When one of the background tasks raises an exception, all the ExceptionHandlers are informed of the exception so that it can be properly handled / propagated.

How would you call the interface? ExceptionHandlerObservable (not great)?

like image 866
assylias Avatar asked Mar 27 '12 17:03

assylias


People also ask

What is a pattern in math?

In Mathematics, the patterns are related to any type of event or object. If the set of numbers are related to each other in a specific rule, then the rule or manner is called a pattern. Sometimes, patterns are also known as a sequence. Patterns are finite or infinite in numbers.

What are the patterns in our daily life?

The patterns that we observe in our daily lives are those of colours, actions, words, letter, numbers, etc. They can be related to any event or object and can be finite or infinite. In mathematics, patterns are a set of numbers arranged in a sequence such that they are related to each other in a specific rule.

What is an Etsy pattern?

– Etsy Help What is Pattern? Pattern is an easy way to set up your own website for your brand, in addition to your Etsy shop. A website can give your business more exposure and help you reach new potential buyers outside of the Etsy marketplace.

What is the use of a pattern in engineering?

Pattern is replica or model of object which to be created. It is used to make hollow cavity in sand mold in which molten metal is poured and allow solidifying to create object.


2 Answers

It looks like the Observer pattern applied to exception handling. So the interface would probably be named ExceptionObservable or something of the sort.

like image 151
Kiril Avatar answered Oct 16 '22 09:10

Kiril


If you think of an exception being thrown as an event then maybe this is close to the EventBroker design pattern. Maybe you can call this one ExceptionBroker.

like image 3
Kevin Junghans Avatar answered Oct 16 '22 07:10

Kevin Junghans