object oriented design in java