CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2000
    Location
    Germany
    Posts
    645

    COM/CORBA question

    Hi

    Is it possible with distributed systems COM/CORBA to get the version number of software running on different machines ( windows, sun ,linux ..)

    If so please gimme a lead

    Regards

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: COM/CORBA question

    On Windows platforms, you can use WMI or a custom COM server.

  3. #3
    Join Date
    Nov 2000
    Location
    Germany
    Posts
    645

    Re: COM/CORBA question

    Thanx for that

    One COM question

    COM says "COM interfaces are immutable i.e adding methods to interfaces creates new interfaces" solves problem of versioning

    I have an understanding problem with this statement

    In a out-of-proc model COM server , if the server ( dll and exe residing in system32 folder ) is activated by a client ( another remote computer)

    So if a new method is added to the existing interface ( in server program ) , it creates a new DLL and EXE .

    We should install these components on the server computer , replacing the older components.
    So the new server component will support the old and new interface which means , the clients using older interface and those clients which will use newer interface will work

    Is my understading correct ?

    Regards

  4. #4
    Join Date
    Mar 2003
    Location
    The Netherlands
    Posts
    586

    Re: COM/CORBA question

    If you want to add a function to an interface you have to create a new interface which is derived from the current interface. You can not add a function to an existing interface.
    This way older clients still work and newer clients (which will use the new interface) also work.
    Time is fun when you're having flies

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: COM/CORBA question

    If you want to maintain backward compatibility, the general practice is to add a new interface to the COM server. For example, say I have a ICalculator interface with an Add( ) method and have several clients using it. Now, I want add a Subtract( ) method to the interface. If I modify the ICalculator interface (so now it contains Add() and Subtract( ) methods) it will break the clients. To avoid this, I just leave the ICalculator interface intact and add an additional ICalculatorEx interface to the COM server. The ICalculatorEx would contain both methods and the ICalculator would only contain the original method.

    Btw, in C# and using the WCF, this sort of versioning problem just got a whole lot easier. With WCF, you can version each individual property and method within a data contract and each client using the data contract just specifies the version it needs. When it comes time to adding properties or methods, new props/methods get added with a different version attribute. The cool thing is that existing clients need not be changed because the system will send the proper data contract based on the requested version. New clients just specify the new version to get the new changes. It's pretty cool, but I digress.

  6. #6
    Join Date
    Nov 2000
    Location
    Germany
    Posts
    645

    Re: COM/CORBA question

    Hi

    C# and .NET , has better ways to implement distributed systems but since i am starting withe COM , i think its better to have a clear understanding of COM first

    But any way thanks for the reply , which makes my understanding better of COM technology

    Regards

  7. #7
    Join Date
    Nov 2000
    Location
    Germany
    Posts
    645

    Re: COM/CORBA question

    Hi

    Thanx for the versioning problem answer

    In wikipedia it reads
    " WMI allows scripting languages like VBScript or Windows PowerShell to manage Microsoft Windows personal computers and servers, both locally and remotely. "

    Does this mean ,

    1. Can i access the version number or build number of a component from a windows PC
    2. Can i also access which components are connected with this main component ?
    3. Can i check which application server and database are connected with this main component ?

    As for other systems like SUN SOLARIS , IBM machines , is there way to access these infrmation , is it possible with CORBA ?


    Regards

  8. #8
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: COM/CORBA question

    With WMI, you can retrieve a list of installed applications (providing that these applications have been installed with a newer app installer).

    In other words, if an app was installed by copying over some files onto the system and then creating a shortcut, WMI will not be able to detect this 'install', but AFAIK WMI can detect apps installed with the newer msi installer technologies.

    Other than using WMI, you can always write your own COM server component that is located on the machine you wish to check for the installed programs. The within this application would need to be written to locate the types of programs you are interested in. If the programs you are interested in have registered COM components, you can use the COM appid, perform a registry lookup for the app installation path, and then load up the app to retrieve the application version. If the app in question isn't a COM app, you'll need to use more brute force methods to locate the app in order to retrieve the version info.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured