100% found this document useful (1 vote)
782 views2 pages

Realtionship Between Class and ADT

Classes are used to define abstract data types (ADTs). An ADT hides its internal representation and exposes operations through a well-defined interface, similar to how classes encapsulate data and member functions. Classes implement the concept of data abstraction through properties like information hiding. For example, a Book class could define a Book ADT by encapsulating book data and functions without revealing implementation details. ADTs and classes both combine data and relevant operations, forming the foundation of object-oriented programming.

Uploaded by

Susmita Dhital
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
782 views2 pages

Realtionship Between Class and ADT

Classes are used to define abstract data types (ADTs). An ADT hides its internal representation and exposes operations through a well-defined interface, similar to how classes encapsulate data and member functions. Classes implement the concept of data abstraction through properties like information hiding. For example, a Book class could define a Book ADT by encapsulating book data and functions without revealing implementation details. ADTs and classes both combine data and relevant operations, forming the foundation of object-oriented programming.

Uploaded by

Susmita Dhital
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Relationship between class and ADT

From the imperative view, an abstract data type (ADT) is a special type of data type, whose
internal representation is hidden from the client. It set of data values and associated operations
that are precisely specified independent of any particular implementation.An ADT is considered
abstract because the operations performed on it are separated from the underlying
implementation. An ADT hides the implementation of a data structure behind a well-defined
interface. Whereas a class is a model or blueprint or prototype of an object that defines or
specifies all the properties of the objects. It have the data and its associated function wrapped in
it. It defines the state and behaviours of an object that contain the data members and member
functions. Once a class is created, we can create any number of objects belonging to that class.
Actually, a class doesn’t specify any data, it determines the properties or methods that may
contain in an object of that class. Classes normally act like a built-in data type, but they are
actually a user-defined data types. The imperative ADTs are considered as a basis for object
orientation as abstract data types form the foundation for the concept of classes used for object
orientation.
Class are very useful in creating ADT. Classes uses the concept of data abstraction, known as
abstract data types. ADT is a set of objects and operations, which focuses on what the operations
are but not how the operations will be implemented. Objects such as lists, graph and sets along
with their operations can be viewed as abstract data types. Object is an interface to a class or
abstract data type through which we can access its properties and functions. Objects have
memories associated with them used for storing data. For example, in building a system to track
the inventory of a library, we wanted a Book ADT. So we create book as class.

ADT must usually contain some internal data. These are declared as data members of the class.
we use classes to define our own abstract data types (ADT).Because ADT consists of data
member and member function as well as class also contain data member and member function.
Formally, an ADT is a user-defined data type where the representation of and operations on
objects of the type are defined in a single syntactic unit; also, other units can create objects of the
type. the representation of objects of the type is hidden from the program units that use these
objects, so the only operations possible are those provided in the type's definition.

An abstract data type is more than a set of values. When an abstract data type is used to create an
object, it can also have methods attached to it and details of these methods are hidden from the
user. So, data abstraction and ADTs are considered as a cornerstone for object orientation as they
can be created when needed..

Classes usually involve additional the concept of data encapsulation and information hiding
which is the concept of data abstraction. Classes provide encapsulation and information hiding
by access control. A class can either give access or deny access to its objects using the public and
private access specifiers. Public members can define an interface between a class and the users of
that class and can be accessed by any function in a program. Objects contain both public and
private variables. These concept of classes and objects are the foundation of imperative ADTs.

You might also like