Topic
3 replies Latest Post - ‏2007-09-06T11:54:00Z by mgawinecki
mgawinecki
mgawinecki
3 Posts
ACCEPTED ANSWER

Pinned topic Grouping variables in internal static classes

‏2007-06-29T10:31:14Z |
Hi,

I'm trying to group some of variables used only by a single class to make it more legible by use of the following construction:

code
public class WaitingRoom {

static class News {
public static long newTemplateGenerationTime = 0;
public static long newProtocolGenerationTime = 0;
}

static class Queues {
public static Map<String, ClientPlaceholder> waitingForInformation;
public static Map<String, ClientPlaceholder> waitingForStrategy;
public static Map<String, ClientPlaceholder> waitingForNegotiation;
}

...
}
[/code]

What do you think about this approach ?
Will it loose much of its efficiency, when access to particular variable goes through another reference, e.g. [i]Queue[/i] static class
Updated on 2007-09-06T11:54:00Z at 2007-09-06T11:54:00Z by mgawinecki
  • mgawinecki
    mgawinecki
    3 Posts
    ACCEPTED ANSWER

    Re: Grouping variables in internal static classes

    ‏2007-07-02T15:26:09Z  in response to mgawinecki
    Where should I put or more generally, what should I do to get response for my question ?

    Maciej
    • SystemAdmin
      SystemAdmin
      210 Posts
      ACCEPTED ANSWER

      Re: Grouping variables in internal static classes

      ‏2007-09-05T17:32:53Z  in response to mgawinecki
      Hi, as per my knowledge static classes/methods/variables are very efficient but its hard to use. If you are using static classes/methods/variables be careful because you can't change value of it.
      • Siva Sangipa.
      • mgawinecki
        mgawinecki
        3 Posts
        ACCEPTED ANSWER

        Re: Grouping variables in internal static classes

        ‏2007-09-06T11:54:00Z  in response to SystemAdmin
        > Hi, as per my knowledge static
        > classes/methods/variables are very efficient but its
        > hard to use.

        How do you know they are efficient ? Why ?
        Why is it hard to use ? Was it hard for you ?

        > If you are using static
        > classes/methods/variables be careful because you
        > can't change value of it.

        You were probably thinking about initialized final variables.

        Maciej