View Single Post
  #1 (permalink)  
Old 03-13-2005
japanman japanman is offline
Registered User
 
 
Join Date: Nov 2004
Posts: 2
object factories in slice

Hello all,
I've found in the overview web pages an interesting way to play with objects factories
----
interface Invoice {
void addItems(ItemSeq items);
void submit();
};
interface InvoiceFactory {
Invoice* create();
};
----

that makes the usage of factories very simple (this is the python sample)
----
# Create a proxy for the invoice factory object.
proxy = communicator.stringToProxy("InvoiceFactory:tcp -p 9000")

# Narrow the proxy to the proper type.
factory = Biz.InvoiceFactoryPrx.checkedCast(proxy)

# Use the factory to obtain a proxy for a new invoice object.
invoice = factory.create()
----

Unfortunately, I'm not able to find in the documentation and in the samples other usages of this technique: is it possible to have more details (perhaps a working server implementation) ?

Thanks in advance
/gp
Reply With Quote