in reply to Re: OO APIs and FP interfaces (storage scope)
in thread OO APIs and FP interfaces
Great alternative, thanks! I see your point about additional work in the module to verify (and if necessary protect) correct operation, yet this seems to be a nice hybrid between giving a caller the ability to prepare a partially configured template and the flexibility to instantiate usable objects out of the templates. This is an excellent extension of the design options I originally proposed.
This also has the benefit of being subclass-friendly, which choroba noted earlier as a flaw in package-scoped lexicals.
|
---|