Quote:
|
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.
Quote:
|
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.