VMWare API nonsense
-
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 renamedVMware.Vim.VimClient
toVMware.Vim.VimClient**Impl**
:wtf: and made a freakin' Interface namedVMware.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... -
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 renamedVMware.Vim.VimClient
toVMware.Vim.VimClient**Impl**
:wtf: and made a freakin' Interface namedVMware.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...but isn't
VMware.Vim.VimClientImpl
aVMware.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!
-
but isn't
VMware.Vim.VimClientImpl
aVMware.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!
Yes, but how do I know which to instantiate?
-
Yes, but how do I know which to instantiate?
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. -
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.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.)
-
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.)
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. -
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.CDP1802 wrote:
you could compile different versions with different references and conditional compilation
Yeah, that way madness lies.
-
CDP1802 wrote:
you could compile different versions with different references and conditional compilation
Yeah, that way madness lies.
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. -
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.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.