Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-05-2005
annekat annekat is offline
Registered User
 
Name: Christophe Avare
Organization: Dassault Systèmes
Project: n/a at the moment
 
Join Date: Jul 2004
Location: Paris
Posts: 34
Lightbulb New streaming API comments

1/ How to reset an Out/InputStream ?
There is a promising method BasicStream.reset() that allow stream recycling, but no clear equivalent in the user defined interfaces.
What is the behavior of the stream created by Ice.Util.createXXXStream(..) after a call to finish? Can it be reused for a new message?

2/ Useless code?
The BasicOutputStream is written as:
Code:
public class BasicOutputStream extends BasicStream
{
    public
    BasicOutputStream(Instance instance, Ice.OutputStream out)
    {
        super(instance);
        _out = out;
    }

    public Ice.OutputStream _out;
}
The _out argument is not used, and the only code that creates BasicOutputStream is in the OutputStreamI implementation:
Code:
public class OutputStreamI implements OutputStream
{
    public
    OutputStreamI(Communicator communicator)
    {
        _communicator = communicator;
        _os = new IceInternal.BasicOutputStream(Util.getInstance(communicator), this);
    }
The second (this) argument is used nowhere and adds no functionality.
Rewritting it as:
Code:
public class OutputStreamI implements OutputStream
{
    public
    OutputStreamI(Communicator communicator)
    {
        _communicator = communicator;
        _os = new IceInternal.BasicStream(Util.getInstance(communicator));
    }
have the same effect.
The BasicOutputStream class can be entirely removed without breaking any client.
Reply With Quote
  #2 (permalink)  
Old 03-05-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Quote:
Originally Posted by annekat
1/ How to reset an Out/InputStream ?
There is a promising method BasicStream.reset() that allow stream recycling, but no clear equivalent in the user defined interfaces.
What is the behavior of the stream created by Ice.Util.createXXXStream(..) after a call to finish? Can it be reused for a new message?
No, a stream cannot be reused.
Quote:
The BasicOutputStream class can be entirely removed without breaking any client.
The BasicOutputStream class is not for use by Ice applications, as indicated by the fact that it is in the IceInternal package. This class is definitely necessary, but the reason is complex.

- Mark
Reply With Quote
  #3 (permalink)  
Old 03-05-2005
annekat annekat is offline
Registered User
 
Name: Christophe Avare
Organization: Dassault Systèmes
Project: n/a at the moment
 
Join Date: Jul 2004
Location: Paris
Posts: 34
Quote:
Originally Posted by mes
This class is definitely necessary, but the reason is complex.
I really am interested in to discover the rational behind this design.
Can you provide some background?

And you can add this question to the shoplist:

Why the BasicStream is a kind of input/output mixin class?
(Usually, input and output related funtionnalities are provided by separate interfaces, eventually collapsed into one "full duplex" at some time in the stream type hierarchy.)

Thanks
Reply With Quote
  #4 (permalink)  
Old 03-05-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Quote:
Originally Posted by annekat
I really am interested in to discover the rational behind this design.
Can you provide some background?
As you've seen, the default implementation of the stream API delegates to the BasicStream class. To allow the stream implementations to handle object marshaling, we needed a way to pass state (namely, the stream object) through the object marshaling methods such as __write(IceInternal.BasicStream). By creating a simple subclass of BasicStream, we can attach state to the BasicStream instance and retrieve it later (see the implementation of Ice.ObjectWriter, for example).

Quote:
Why the BasicStream is a kind of input/output mixin class?
I'll let Marc answer that.

- Mark
Reply With Quote
  #5 (permalink)  
Old 03-06-2005
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
BasicStream is both an input and output stream because this simplifies Ice internals. Other than that I cannot provide more information, as discussing Ice internal design details (BasicStream is an internal class, i.e., the Ice application developer must not use it) is out of the scope of the support we can give here on this message board.
Reply With Quote
  #6 (permalink)  
Old 03-06-2005
annekat annekat is offline
Registered User
 
Name: Christophe Avare
Organization: Dassault Systèmes
Project: n/a at the moment
 
Join Date: Jul 2004
Location: Paris
Posts: 34
Quote:
Originally Posted by marc
discussing Ice internal design details ... is out of the scope of the support we can give here on this message board.
Take no offense, please!
This is not a support request (thus i use this 'comments' newsgroup), just user feedback.
The streaming API is new, its documentation minimalistic and of great interest for us. It just appears that its structure is slightly different of what we are accustomed to see in other streaming libraries, and we are looking for the best way to adapt ourselves.

I understand you provide the best support for your product and you need to get time to develop it and make some business with it.

Regards.
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
Need Help with Streaming zhi Help Center 14 01-09-2007 10:40 PM
streaming function "write/readContext" for Ice::Context sylvain Help Center 0 09-13-2006 06:14 AM
Question about of readObject() in Streaming Interface kongchoy Help Center 2 02-08-2006 12:55 PM


All times are GMT -4. The time now is 08:16 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.