jeudi 25 août 2016

Why there are no destructor patterns?

I have seen and used many times creational patterns like Builder or Factory. I think there many advantages to control the creation of (business) objects and not let users create these objects in whatever way they see fit.

I think that these concerns apply also when you wish to destroy such objects. For example, to ensure that resources are properly closed and freed. Despite this, I have never seen any mention of patterns related to the destruction of objects.

Do you know if any such patterns exist and, if not, why is it not reasonable to have such patterns?

Aucun commentaire:

Enregistrer un commentaire