Home Help Center

Concept question about ICE Object

OrNotOrNot Member Bin.LiOrganization: GE HealthcareProject: Enterprise solution
hi, there,
Because I have to write some documents about Ice, I now have a concept question about ICE Object:

In Ice-Document, an object is defined as :

• A single Ice object can be instantiated in a single server or, redundantly, in multiple servers. If an object has multiple simultaneous instantiations, it is still a single Ice object.
• Each Ice object has a unique object identity. An object’s identity is an identifying value that distinguishes the object from all other objects. The Ice object model assumes that object identities are globally unique, that is, no two objects within an Ice communication domain can have the same object identity.

I can not fully understand these two points together. That is, If an object has multiple simultaneous instantiations, it is still a single Ice object , then , all these instantiations will have the same identity? It seems conter-intuitive.

Hope getting a clarification.

Thanks

OrNot

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Everything you wrote above is correct. What do you find confusing?

    Keep in mind that an Ice object is an abstract concept, unlike servants that correspond to real programming-language objects.

    Cheers,
    Bernard
  • OrNotOrNot Member Bin.LiOrganization: GE HealthcareProject: Enterprise solution
    hi, Benard,
    I think my confusion may come from codes like this:


    Ice::ObjectPtr object1 = new PrinterI;
    Ice::ObjectPtr object2=new PrinterI;
    adapter->add(object1,
    Ice::stringToIdentity("SimplePrinter"));
    adapter->add(object2,
    Ice::stringToIdentity("SimplePrinter2"));


    PrinterI is an Object, and it's incarnations are two servants, but they have different identities. Accroding to : (1) If an object has multiple simultaneous instantiations, it is still a single Ice object. and (2) Each Ice object has a unique object identity, does it mean Object1 and Object2 should have a same
    identiy ,say, SimplePrinter?
    There must be some misundersandings in my mind but I can not figure it out.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    PrinterI is a type (a class or interface), not an object. You create two servants of the type PrinterI. In your example, each servant implements a different Ice object. One Ice object has the identity "SimplePrinter", the other "SimplePrinter2".
  • OrNotOrNot Member Bin.LiOrganization: GE HealthcareProject: Enterprise solution
    Maybe I misunderstood these ICE concepts due to some c++ experiences and this words: If an object has multiple simultaneous instantiations, it is still a single Ice object.

    Class == Ice Object
    Object == Servant



    OK then , Thank you very much.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    No, this is not correct, also not for C++. A class is a type, both in C++ and in Slice.

    Have a look at this FAQ which discusses proxies, Ice objects, and servants.
Sign In or Register to comment.