3 ms·
Unless there was a great case for it, it would be dismissed as you said. I had a reasonably legitimate usecase for this pattern recently, wherein there is a si
by theelous3 6y ago
Unless there was a great case for it, it would be dismissed as you said.
I had a reasonably legitimate usecase for this pattern recently, wherein there is a singleton pattern, but this singleton acts as an kind of metaclassinterface for an instanciator under the hood.
The user would inherit from a base class, define the required abstract methods, and create a singleton for use in decorations. The invocation of this singleton spawns an instance of the internal engine and gives it access to the custom functionality the user defined in the abstract methods, by assignment of the bound method to the internal instance.