5 Replies Latest reply on Aug 6, 2007 4:59 PM by 791266

    How to enforce developers to override toString() method


      Right now we are in design stage of our application. I want that all our BO classes should override toString(), equals() and hashCode() methods.

      We expect that our application would be running for next 5 to 10 years, and so looking for ways to enforce these rules to developers.

      One way to do is let ant script handle such validations. Another way could be using PMD to enforce rules.

      These could be good ways of doing this, but my manager doesnot quite like to depend on external tools like these ... as 5 years down the line you donot know state of these tools.

      Can someone suggest if java provides any such provision ...

      If someone has some smart solution do let me know ... your help is much appreciated ... and thanks in advance.

      Rana Biswas