jeudi 4 avril 2019

Is there a good software pattern to handle a case where I want an outer wrapper class that abstracts away the fragile lifecycle of an inner class?

I am running into a common case where I have particular class that has a short unpredictable life cycle.

I want to abstract away and handle errors internally so outer code need not know, nor be concerned with an object of the class being disposed, or being in an invalid state.

It is a bit similar to the factory pattern, but it has an added element of abstracting away transient errors.

Is there a good software pattern that handles this particular problem already, and/or is there a library framework to do it?

To abstract this away, im using a wrapper class ive made that outer code can use without needing to worry about most errors, nor needing to recreate the class.

Aucun commentaire:

Enregistrer un commentaire