Type Isomorphisms: this is more an open theory question than a practical programming question
-
What do you think of declaring type isomorphisms for extending the functionality of an existing class where no prior interface contract exists? To provide a barely contrived, concrete example, let's take an Excel Interop Worksheet and a business-customized Excel export process. The existing ExcelWorksheet structurally subtypes the COM proxy and has a unified way of exporting given data of an arbitrarily defined range into a blank Worksheet. Let's say that I don't need any of the existing functionality to change, but wish to subvert the preparation of the underlying worksheet object to be replaced with a worksheet prepared outside the wrapper....and let's say that what I really want to have is a development environment where the structurally subtyped Interop proxy contained within the custom ExcelWorksheet is not treated as a property, but merely a component of the custom "ExcelWorksheet" composition...with a quick way to switch contexts from "Interop Proxy" to "Custom Wrapper around Interop proxy" with an isomorphic cast.
"I need build Skynet. Plz send code"
-
What do you think of declaring type isomorphisms for extending the functionality of an existing class where no prior interface contract exists? To provide a barely contrived, concrete example, let's take an Excel Interop Worksheet and a business-customized Excel export process. The existing ExcelWorksheet structurally subtypes the COM proxy and has a unified way of exporting given data of an arbitrarily defined range into a blank Worksheet. Let's say that I don't need any of the existing functionality to change, but wish to subvert the preparation of the underlying worksheet object to be replaced with a worksheet prepared outside the wrapper....and let's say that what I really want to have is a development environment where the structurally subtyped Interop proxy contained within the custom ExcelWorksheet is not treated as a property, but merely a component of the custom "ExcelWorksheet" composition...with a quick way to switch contexts from "Interop Proxy" to "Custom Wrapper around Interop proxy" with an isomorphic cast.
"I need build Skynet. Plz send code"
I tend to think that they're just as good an idea as any. If you don't need to subtype the existing class, you don't need to change the way it performs its existing behavior, there's no composition model in place but need to be able to optionally rearrange the way the custom object wraps around a structurally subtyped object, I say "sure."
"I need build Skynet. Plz send code"