Results 1 to 5 of 5

Thread: Ice.Application feature requests

  1. #1
    bartley is offline Registered User
    Name: Chris Bartley
    Organization: Carnegie Mellon University Robotics Institute
    Project: The Telepresence Robot Kit (TeRK)
    Join Date
    Dec 2005
    Posts
    52

    Ice.Application feature requests

    For the Java language mapping, I'd like to request the following for the Ice.Application class:

    1) New overloaded main() methods with support for loading Ice properties files stored in jars. Perhaps an InputStream, or at least a java.util.Properties instance. It's pretty common practice to store properties files in jars, which isn't currently very convenient with Ice (see http://www.zeroc.com/vbulletin/showt...=8906#post8906). I'd expect the load() method in Ice.Properties to be overloaded in a similar way.

    2) Javadoc comments instead of //-style comments. Several of the comments in Ice.Application are very important to the user. Comments that aren't javadoc don't do me any good unless I know they're there.

    Speaking of the comments in Ice.Application, one of them reads:

    One limitation of this class is that there can only be one Application instance, with one global Communicator, accessible with this communicator() operation. This limitiation is due to how the signal handling functions below operate.
    Maybe I just need to look at the code more, but isn't the limitation actually due to _communicator (and associated members and methods) being static? Is there really a need for it to be static? In any case, this comment should definitely be a javadoc comment.

    thanks!

  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
    Quote Originally Posted by bartley
    2) Javadoc comments instead of //-style comments. Several of the comments in Ice.Application are very important to the user. Comments that aren't javadoc don't do me any good unless I know they're there.
    We'll keep this in mind, but I doubt we will do this anytime soon. We try to keep the source code for the various Ice versions for different languages as similar as possible, including comments. This makes it a lot easier to maintain support for so many languages. For example, we can simply cut&paste comments from one Ice version to another.

    Quote Originally Posted by bartley
    Maybe I just need to look at the code more, but isn't the limitation actually due to _communicator (and associated members and methods) being static? Is there really a need for it to be static?
    Ice.Application is just a helper class, intended to be used for applications that only require one communicator. For such applications, making the communicator static makes the code less verbose (because you can access the communicator everywhere in your code, without having to pass it around).

    Of course you can also write Ice applications without this helper class, or write your own helper class.

  3. #3
    bartley is offline Registered User
    Name: Chris Bartley
    Organization: Carnegie Mellon University Robotics Institute
    Project: The Telepresence Robot Kit (TeRK)
    Join Date
    Dec 2005
    Posts
    52
    We'll keep this in mind, but I doubt we will do this anytime soon. We try to keep the source code for the various Ice versions for different languages as similar as possible, including comments. This makes it a lot easier to maintain support for so many languages. For example, we can simply cut&paste comments from one Ice version to another.
    If the motivation is really for ease of cutting & pasting then why not use block comments? That would be easier for cutting & pasting, and still allow you to use javadoc comments for the java folks. And for languages that don't have block comments (if any?), then you still have to muck around anyway with the per-line comment characters (since I doubt they're all the same), so no big loss.

    Regardless, my point wasn't really about the style of the comment, but rather that I shouldn't have to read the code to correctly use the code. Using a Javadoc comment would satisfy that goal for at least the Java folks.

    Ice.Application is just a helper class, intended to be used for applications that only require one communicator. For such applications, making the communicator static makes the code less verbose (because you can access the communicator everywhere in your code, without having to pass it around).
    But is it necessary? Why not make it non-static and not a singleton and let the developer decide whether it should be statically accessible? For example, something like this:

    Code:
    public final class ChatClient extends Ice.Application()
       {
       private static final ChatClient INSTANCE = new ChatClient();
       static
          {
          // some sort of initialization of INSTANCE here...
          }
       
       public static ChatClient getInstance()
          {
          return INSTANCE;
          }
    
       // ...
       }
    
    // code in other classes which need the communcator could get it like this:
    ChatClient.getInstance().getCommunicator();
    Wouldn't such an approach satisfy both the people who need only one communicator as well those who want/need multiples?

    Sorry, I'm not trying to be argumentative. Maybe there's some other technical reason that I'm missing, but I think avoidance of code verbosity is a poor motivation for the current design.

  4. #4
    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
    It is simply a design choice. Ice.Application is for applications that require only one communicator, and it is optimized for this use. As I wrote above, it's just a helper class, and you can choose not to use it if it doesn't fit your requirements. Have a look at the Ice manual (chapter 3.4) for code that initializes an Ice application directly, without the Ice.Application helper class.

  5. #5
    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
    Quote Originally Posted by bartley
    If the motivation is really for ease of cutting & pasting then why not use block comments? That would be easier for cutting & pasting, and still allow you to use javadoc comments for the java folks. And for languages that don't have block comments (if any?), then you still have to muck around anyway with the per-line comment characters (since I doubt they're all the same), so no big loss.
    I don't think this is a good idea, because this would give our code comments the status of a reference documentation. However, the comments were neither intended to be used as reference, nor would they be complete enough to serve as reference. The comments are only for the developers of Ice or for students of the source code, but not for application developers. The reference documentation for Ice application developers is the Ice manual.

    Quote Originally Posted by bartley
    Regardless, my point wasn't really about the style of the comment, but rather that I shouldn't have to read the code to correctly use the code. Using a Javadoc comment would satisfy that goal for at least the Java folks.
    Ice.Application is described in detail in the Ice manual (chapter 12.3.1), including a description of its limitations. There should be no reason to read the source code comments to use Ice.Application. If the documentation in the manual is incomplete, please let us know what's missing.
    Last edited by marc; 02-05-2006 at 02:09 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 233
    Last Post: 04-06-2012, 01:31 PM
  2. Feature list / description of Ice on website
    By Minthos in forum Comments
    Replies: 4
    Last Post: 09-03-2009, 06:49 AM
  3. Ice 3.3 Feature Discussion
    By mes in forum Comments
    Replies: 18
    Last Post: 04-02-2008, 12:42 PM
  4. Replies: 7
    Last Post: 02-17-2006, 11:30 PM
  5. tests enhancement requests
    By marlowa in forum Comments
    Replies: 1
    Last Post: 02-20-2003, 07:51 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
  •