Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 06-30-2003
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
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
Reply With Quote
  #2 (permalink)  
Old 06-30-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,773
Sure, we could do this, but what do you need it for?
Reply With Quote
  #3 (permalink)  
Old 06-30-2003
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 891
Re: Type id

Quote:
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.
Reply With Quote
  #4 (permalink)  
Old 07-01-2003
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
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.
Reply With Quote
  #5 (permalink)  
Old 07-01-2003
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 891
Quote:
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.
Reply With Quote
  #6 (permalink)  
Old 07-02-2003
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
Quote:
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.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java: going from String to Enum Type nightnday Help Center 2 03-21-2006 02:32 PM
How to define a variant type? fengxb Help Center 2 07-31-2005 10:45 AM
Can I use Ice's smart pointer with my own type? timeguest Help Center 1 06-27-2005 04:17 AM
Dynamic type knowledge kovacm Help Center 2 01-28-2005 12:43 PM
ICE don't take wchar_t as original C++ type _orchid_ Bug Reports 1 12-01-2003 01:28 PM


All times are GMT -4. The time now is 03:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.