Benefits of Abstract Data Types


Is it worth the bother of creating classes?  Why not just put all our code
in one giant main method?  Well, for really small programs, that's probably fine.
But as soon as you get over 100 lines or so, you'll start having difficulties.
ADT's solve many of these problems.

Simple

ADT's let us express our solutions using the vocabulary of the problem domain,
and the messy translation to the language level is hidden.  Thus our code is simpler
because it is as a higher level of abstraction, and inessential details are hidden.

Maintainable

All the operations and data are encapsulated in one place, so changes are isolated.
We can modify the implementation without altering the public interface thus
limiting the scope of changes.

Reusable

The ADT is a stand-alone component; all the data and operations are bundled together.
Thus it can be reused at the binary level (via import, for example), thereby reducing
the effort need to build upon it.

Integrity

Client programs can't directly modify private fields, thus preventing accidental
changes that could cause errors.