next up previous
Next: Design methodology for a Up: Unit 03 Previous: Standard constructor

Design methodology for a class: realization of a class

We present a methodology for designing a class in various steps, which will allow us to realize Java classes in a structured way, by dividing the problem in various sub-problems, and addressing each of them separately. In this way we will be able to deal with the complexity of realizing a class in a simple and effective way.

  1. Starting from the specification of a class, we identify the properties and the services of the class to realize.
  2. We choose a representation for the objects of the class, by identifying the instance variables that are necessary.
  3. We choose the headers of the public methods of the class (the interface of the class). Note that in this step we are deciding in which way the clients of the class have to use the objects of the class we are realizing.
  4. We realize the body of the public methods, possibly by introducing auxiliary methods in order to simplify and structure the code.


next up previous
Next: Design methodology for a Up: Unit 03 Previous: Standard constructor