Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to enforce developers to override toString() method

807605Aug 6 2007 — edited Aug 6 2007
Hi,

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.

Regards,
Rana Biswas
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 3 2007
Added on Aug 6 2007
5 comments
290 views