Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would encourage you to use classes when you have methods that may require more or less nullable arguments; it gives you the ability to provide whatever you need without having to call a method like:</p> <pre><code>someMethod("foo", null, null, null, null, null, null, ..., "bar"); </code></pre> <p>Using such mecanism, the method call would be something like :</p> <pre><code>someMethod(new ObjParam().setFoo("foo").setBar("bar")); </code></pre> <p>The second method is expendable and reusable (without a tons of method overrides). And I'm not saying here that method override is bad! Quite the opposite. However with many optional arguments, I would prefer the second call.</p> <p>As for inner classes, they are useful at times, but I personally follow these guidelines:</p> <ol> <li>try to use inner classes only when the inner class should be private (ex: in the case of a custom LinkedList implementation, the Node class is a private class and is therefore an inner class.)</li> <li>usually only if the class is not reusable and used mainly within a (very) small group of classes that I will make it an inner class</li> <li>The "parent" and inner class becomes big enough; then both class are given their own Java source file for readability, unless the inner class should be private as for the first point.</li> </ol> <p>Keep in mind that, inner class or not, the Java compiler <strong>will</strong> create a .class for every class. The more you use them, less readable your code will be. It's pretty much up to you to decide whether or not they're justified or not... </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload