View RSS Feed

Recent Blogs Posts

  1. Using Imports to Change Behaviour

    by , 11-29-2011 at 04:24 AM
    One thing that would be great to have is a feature that I know well from my previous experience coding in C. That is the possibility to conditional compile in order to modify the behaviour of the application. A feature that is missing from Java is C’s conditional compilation, which allows you to change a switch and get different behaviour without changing any other code. I think is was left out of Java is that I remember using this feature often to address issues related to compiling a program ...
    Categories
    Classes
  2. Managing Initialization and Class Loading

    by , 11-29-2011 at 04:20 AM
    Java avoids many of the problems found with other languages related to the startup and initialization of objects in the right order, by taking a different approach to loading. The key to this is that everything in Java is an object. Each class exists in its own separate file. Therefore files are not loaded until the code is needed. The expression of this is that “class code is loaded at the point of first use.” This is usually when the first object of that class is constructed, but loading also ...
  3. Construction for Your Java Classes with Many Parameters

    by , 11-29-2011 at 02:10 AM
    Traditionally when programmers have to create a constructor that has lots of parameters, some that are required and other that are optional, they often will either build several constructors or use the telescoping constructor pattern. For those of you not aware, the telescoping constructor pattern is where you provide constructors for the class with the required parameters, and then others constructors that cover the other optional parameters. So depending on the number of parameters and whether ...

    Updated 11-30-2011 at 03:06 PM by Design Patterns

    Categories
    Builder Pattern