Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-20-2006
rc_hz rc_hz is offline
Registered User
 
Name: Eric RC
Organization: www.genband.com
Project: No project yet
 
Join Date: Jul 2004
Location: Hangzhou, China
Posts: 189
Send a message via MSN to rc_hz
-->
Node or NodeI ?

Page 368 in Ice 3.1.0 document:
Code:
12.8.1Instantiating a Servant
  Instantiating a servant means to allocate an instance:    
      Node servant = new NodeI("Fred");
      
  This code creates a new NodeI instance and assigns its address to a reference of 
  type Node. This works because NodeI is derived from Node, so a Node reference
  can refer to an instance of type NodeI. However, if we want to invoke a
  member function of the NodeI class at this point, we must use a NodeI reference:
      NodeI servant = new NodeI("Fred");
  
  Whether you use a Node or a NodeI reference depends purely on whether you
  want to invoke a member function of the NodeI class: if not, a Node reference
  works just as well as a NodeI reference.
That is, the document emphasizes that if we want to invoke a member function of the XXXI class, we must use a XXXI reference instead of XXX interface reference. Can you explain a little more why ?

Further, in %ICEJ_HOME%\demo\book\simple_filesystem\Server.jav a:
Code:
	File file = new FileI("README", root);                                      
	String[] text;                                                              
	text = new String[] { "This file system contains a collection of poetry." };
	try {                                                                       
		file.write(text, null);
	} catch (GenericError e) {                                                  
		System.err.println(e.reason);                                       
	}
Are they inconsistent ?

Thank you !
__________________
Eric RC
www.genband.com (telecommunication)
I like ICE (Ice for C++/Java/Python)

Last edited by rc_hz : 08-20-2006 at 03:01 AM.
Reply With Quote
  #2 (permalink)  
Old 08-20-2006
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,781
What is meant here are member functions of NodeI that are not defined in the Slice definition of Node.
Reply With Quote
  #3 (permalink)  
Old 08-20-2006
rc_hz rc_hz is offline
Registered User
 
Name: Eric RC
Organization: www.genband.com
Project: No project yet
 
Join Date: Jul 2004
Location: Hangzhou, China
Posts: 189
Send a message via MSN to rc_hz
-->
Quote:
Originally Posted by marc
What is meant here are member functions of NodeI that are not defined in the Slice definition of Node.
Thanks. So it is just a problem of inheritance. I think this paragraph is a little misleading.
__________________
Eric RC
www.genband.com (telecommunication)
I like ICE (Ice for C++/Java/Python)
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
how to shut down a node? russule Help Center 2 01-08-2007 05:13 AM
node name(s) on multiple servers angelocook Help Center 1 09-01-2006 03:01 PM
Ice.NoEndpointException when any node not start illo Help Center 5 07-20-2006 10:45 PM
what is the meaning of node load's returns? rwxybh Help Center 2 01-04-2006 10:37 PM
IcePack node monitoring brian Help Center 9 10-08-2003 08:01 PM


All times are GMT -4. The time now is 07:57 AM.


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.