- It allows uns to create data types not otherwise available in a programming language
- It allows us to produce off-the-shelf-software, pieces of software that can be used over and over again in different programs by any programmer
An abstract data type has both a specification (the what) and an implementation (the how)
Properties of abstract data types
- Attributes
- Java: fields
- C++: data members or member variables
- Oprations
- Java: methods
- C++: member functions
- Public attributes
- Public operations
Example of informal specification
TYPE
IntList
DOMAIN
Each IntList value is a collection of up to 100 separate integer numbers
OPERATIONS
Insert an item into the list
Delete an item from the list
Return the current length of the list
Print the list
Notice the complete absense of implementation details
Reference: wikipedia, google books, thefreedictionary
2 comments:
Nice blog eamon. started reading. but it will be more helpful if could avoid bookish words like interface (because it is a keyword in java or other languages), or at least give a general description. Also please try to give codes as example. :P
Thanks Maroof. I will remember your suggestion and will try to give codes as example.
Post a Comment