Ice for Visual Basic .NET

The comprehensive features of the Ice platform are available to .NET developers using Ice for Visual Basic .NET. Implemented as a language mapping on top of Ice for C#, Ice for Visual Basic .NET provides full compatibility with the Common Language Runtime and Mono.

Visual Basic .NET

The vast numbers of Visual Basic programmers will find Ice for Visual Basic .NET immensely useful in adding distributed object capabilities to their applications. As one of the few middleware technologies to acknowledge the wealth of development experience represented by Visual Basic programmers, Ice provides a natural language mapping supported by a robust C# implementation.

Sample Code

To illustrate how Ice is used in various language mappings, consider the following Slice interface definitions:

module Biz {
    struct Item {
        string sku;
        int qty;
    };
    sequence<Item> ItemSeq;
     
    interface Invoice {
        void addItems(ItemSeq items);
        void submit();
    };
    interface InvoiceFactory {
        Invoice* create();
    };
};
                                                  

Visual Basic code that creates an invoice using the factory is shown below:

' Create a proxy for the invoice factory object.
Dim proxy As Ice.ObjectPrx = communicator.stringToProxy("InvoiceFactory:tcp -p 9000")
' Narrow the proxy to the proper type.
Dim factory As Biz.InvoiceFactoryPrx = Biz.InvoiceFactoryPrxHelper.checkedCast(proxy)
' Use the factory to obtain a proxy for a new invoice object.
Dim invoice As Biz.InvoicePrx = factory.create()
' Add items to the invoice.
Dim items() As Biz.Item = New Biz.Item(0) {}
items(0).sku = "10-6139"
items(0).qty = 3
invoice.addItems(items)
' Submit the invoice.
invoice.submit()
Copyright © 2008 ZeroC, Inc.