Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Type Isomorphisms: this is more an open theory question than a practical programming question

Type Isomorphisms: this is more an open theory question than a practical programming question

Scheduled Pinned Locked Moved C#
comquestionbusinesstutorialdiscussion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alaric_
    wrote on last edited by
    #1

    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"

    A 1 Reply Last reply
    0
    • A Alaric_

      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"

      A Offline
      A Offline
      Alaric_
      wrote on last edited by
      #2

      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"

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups