Archived

This forum has been archived. Please start a new discussion on GitHub.

Embedding IceGrid into standalone application

Hi everyone,

I'm working on a design of an application which has to work in two modes stand-alone and distributed.

In distributed mode it looks like regular IceGrid application and it is quite clear from the documentation and examples how to set it up. On the other hand, in the stand-alone mode it has to look like simple GUI (Qt) desktop application. It would be great to have single executable, single process running and to have reasonable minimal bootstrapping time.

I've spend few days reading the documentation. Currently I am aware of the collocation optimization and as I see it is possible to run all the servers in a single process with IceBox, and that is great.

But there are some blanks I can't fill at the moment. In the distributed environment there is an IceGrid registry which provides connections to different services. It would be great to have similar service embedded in the application in stand-alone mode. I think such approach leads to maximum code reuse cause the only difference will be configuration files. The same question is about IceBox. Is there a way to embed it into the my stand-alone application?

I would like to discuss this approach. Probably I am inventing bicycle here. Looking for advice.

Thanks in advance ;)

Comments

  • benoit
    benoit Rennes, France
    Hi,

    IceGrid or IceBox aren't really designed to be "embedded" in another process.

    For your IceBox services, you could implement a service container similar to IceBox within your GUI. You have access to the IceBox source code so you should be able to use it as a basis to implement your own service container. This way your distributed deployment can still use IceBox and IceGrid to deploy your services in separate processes (and possibly on separate machines) while your standalone deployment will use your GUI application which will load your services in the same process.

    Regarding IceGrid, this will be an issue if your GUI needs to resolve indirect proxies to your services. You have several ways to solve this problem:
    • Make all your proxies configurable (through properties for example). The distributed deployment can use indirect proxies resolved by IceGrid while the standalone deployment would use direct proxies.
    • Have your GUI application implement the Ice::Locator interface to resolve indirect proxies.

    The first option is simpler if you have a fixed and small number of proxies for each service. The second option is preferable if you have a variable and possibly large number of proxies. Let us know if you need more information!

    Cheers,
    Benoit.
  • Dear Benoit,

    thank you for detailed description of possible solutions. I'll post this tread if (when) I succeed with one of suggested approaches.