Next: Design methodology for a
Up: Unit 03
Previous: Standard constructor
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.
- Starting from the specification of a class, we identify the
properties and the services of the class to realize.
- We choose a representation for the objects of the class, by
identifying the instance variables that are necessary.
- 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.
- We realize the body of the public methods, possibly by introducing
auxiliary methods in order to simplify and structure the code.
Next: Design methodology for a
Up: Unit 03
Previous: Standard constructor