Results 1 to 6 of 6

Thread: Type id

  1. #1
    ganzuoni is offline Registered User
    Name: Guido Anzuoni
    Organization: Individual
    Project: No specific project
    Join Date
    Jun 2003
    Location
    Italy
    Posts
    49

    Type id

    Hi,
    it could be nice to have a way to get the type id of a slice element
    instead of hard-coding the string constant in the source
    (something like CORBA XXHelper.id()).

    Regards,
    Guido

  2. #2
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Sure, we could do this, but what do you need it for?

  3. #3
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055

    Re: Type id

    Originally posted by ganzuoni
    Hi,
    it could be nice to have a way to get the type id of a slice element
    instead of hard-coding the string constant in the source
    (something like CORBA XXHelper.id()).

    Regards,
    Guido
    When you say "Slice element", what do you mean? (Note that you can call ice_staticId() for classes and exceptions.)

    Cheers,

    Michi.

  4. #4
    ganzuoni is offline Registered User
    Name: Guido Anzuoni
    Organization: Individual
    Project: No specific project
    Join Date
    Jun 2003
    Location
    Italy
    Posts
    49
    Hi,
    To Marc:
    the reason is simply avoiding hard-coding the strings, so that in case
    of module renaming you have only to recompile instead of
    search&replace (keys in Map, for example).

    To Michi:
    Oops, yes (obviously) you are right !
    Well, something similar would be nice also for interface.
    Some static constant in XX.java, for example.

    Regards,
    Guido.

  5. #5
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    Oops, yes (obviously) you are right !
    Well, something similar would be nice also for interface.
    Some static constant in XX.java, for example.
    You can call ice_id() on a proxy to get the interface type. Note though that this call goes remote and delivers the actual run-time type, not the static type of the proxy.

    What I don't understand is why you care about the type ID though. Normally, there is little use for the type ID in application code. (The type ID exists mainly to support the Ice run time.) So, why do you need it?

    Cheers,

    Michi.

  6. #6
    ganzuoni is offline Registered User
    Name: Guido Anzuoni
    Organization: Individual
    Project: No specific project
    Join Date
    Jun 2003
    Location
    Italy
    Posts
    49
    Originally posted by michi
    You can call ice_id() on a proxy to get the interface type. Note though that this call goes remote and delivers the actual run-time type, not the static type of the proxy.

    What I don't understand is why you care about the type ID though. Normally, there is little use for the type ID in application code. (The type ID exists mainly to support the Ice run time.) So, why do you need it?

    Cheers,

    Michi.
    Hi,
    well, in the past (when there were no valuetypes) I made extensive use
    of XXHelper.id() to map copnverter to marshal/unmarshal ( )
    CORBA struct to/from internal, CORBA-unaware, object
    (one for all, java.util.Date).
    Anyway, I think you are right, there should be no need for that.
    A useful case is in Communicator.addObjectFactory(), but, as you
    pointed out, classes have ice_staticId() ....

    Sorry for the waste of time, I'll try to be more careful in the future.

    Regards,
    Guido.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IceGrid: How to obtain server ID from object ID
    By jharriot in forum Help Center
    Replies: 1
    Last Post: 07-20-2010, 04:13 AM
  2. Order of ids in id list
    By hawesie in forum Help Center
    Replies: 3
    Last Post: 09-10-2009, 07:27 PM
  3. How adapter id is generated
    By aozarov in forum Help Center
    Replies: 1
    Last Post: 11-27-2008, 03:16 AM
  4. slice definition for type ID?
    By peterlspot in forum Comments
    Replies: 5
    Last Post: 11-28-2007, 10:13 PM
  5. retrieve proxy id
    By steepLearningC in forum Help Center
    Replies: 5
    Last Post: 12-09-2005, 02:01 AM

Posting Permissions

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