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. Other Discussions
  3. The Weird and The Wonderful
  4. VMWare API nonsense

VMWare API nonsense

Scheduled Pinned Locked Moved The Weird and The Wonderful
jsonquestionannouncement
9 Posts 4 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.
  • P Offline
    P Offline
    PIEBALDconsult
    wrote on last edited by
    #1

    I have been using the VMWare VIM API for a while now. The main class I have used is VMware.Vim.VimClient. Now I'm trying to use a newer version of the API. Guess what they did? They renamed VMware.Vim.VimClient to VMware.Vim.VimClient**Impl** :wtf: and made a freakin' Interface named VMware.Vim.VimClient :omg: !!!!! I'd call that mofo breaking change. How am I supposed to write code that can use either version of the API without resorting to Reflection? Tequila, take me away...

    S 1 Reply Last reply
    0
    • P PIEBALDconsult

      I have been using the VMWare VIM API for a while now. The main class I have used is VMware.Vim.VimClient. Now I'm trying to use a newer version of the API. Guess what they did? They renamed VMware.Vim.VimClient to VMware.Vim.VimClient**Impl** :wtf: and made a freakin' Interface named VMware.Vim.VimClient :omg: !!!!! I'd call that mofo breaking change. How am I supposed to write code that can use either version of the API without resorting to Reflection? Tequila, take me away...

      S Offline
      S Offline
      Super Lloyd
      wrote on last edited by
      #2

      but isn't VMware.Vim.VimClientImpl a VMware.Vim.VimClient? So you can use the later and it will work for both?!

      All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!

      P 1 Reply Last reply
      0
      • S Super Lloyd

        but isn't VMware.Vim.VimClientImpl a VMware.Vim.VimClient? So you can use the later and it will work for both?!

        All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        Yes, but how do I know which to instantiate?

        L 1 Reply Last reply
        0
        • P PIEBALDconsult

          Yes, but how do I know which to instantiate?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Use the factory pattern to wrap up the details of instantiation.

          The language is JavaScript. that of Mordor, which I will not utter here
          This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
          "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

          P 1 Reply Last reply
          0
          • L Lost User

            Use the factory pattern to wrap up the details of instantiation.

            The language is JavaScript. that of Mordor, which I will not utter here
            This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
            "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            Wouldn't that still require using Reflection to determine which version of the API is installed on the system at runtime? (Not that it matters; I'm not writing it to be flexible.)

            L 1 Reply Last reply
            0
            • P PIEBALDconsult

              Wouldn't that still require using Reflection to determine which version of the API is installed on the system at runtime? (Not that it matters; I'm not writing it to be flexible.)

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              You might have to use reflection. If you want to avoid that, you could compile different versions with different references and conditional compilation. This could get ugly if you can't limit the setups to only two versions or contain all conditional code in the class factory.

              The language is JavaScript. that of Mordor, which I will not utter here
              This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
              "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

              P 1 Reply Last reply
              0
              • L Lost User

                You might have to use reflection. If you want to avoid that, you could compile different versions with different references and conditional compilation. This could get ugly if you can't limit the setups to only two versions or contain all conditional code in the class factory.

                The language is JavaScript. that of Mordor, which I will not utter here
                This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #7

                CDP1802 wrote:

                you could compile different versions with different references and conditional compilation

                Yeah, that way madness lies.

                L 1 Reply Last reply
                0
                • P PIEBALDconsult

                  CDP1802 wrote:

                  you could compile different versions with different references and conditional compilation

                  Yeah, that way madness lies.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Sometimes you don't get much of a choice. I can remember that the different versions of XNA were not very compatible. At least I managed to keep the version specific things in a baseclass with graphics functions. Containment is everything, or encapsulation in this case.

                  The language is JavaScript. that of Mordor, which I will not utter here
                  This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                  "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                  S 1 Reply Last reply
                  0
                  • L Lost User

                    Sometimes you don't get much of a choice. I can remember that the different versions of XNA were not very compatible. At least I managed to keep the version specific things in a baseclass with graphics functions. Containment is everything, or encapsulation in this case.

                    The language is JavaScript. that of Mordor, which I will not utter here
                    This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
                    "I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns.

                    S Offline
                    S Offline
                    Sinisa Hajnal
                    wrote on last edited by
                    #9

                    You could keep concrete typename for particular installation in a config file (settings table or whatever) and instatiate via Activator class. Then it is only matter of keeping straight who uses what and adjusting the config.

                    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