Advantages of ADTs for program modularity-DS unit 3 PDF

Title Advantages of ADTs for program modularity-DS unit 3
Author Sean Ward
Course Programming 2
Institution University of the People
Pages 2
File Size 80.8 KB
File Type PDF
Total Downloads 110
Total Views 153

Summary

Very useful stuff...


Description

Advantages of ADTs for program modularity An abstract data type (ADT) is a specification of a set of data and the set of operations that can be performed on the data. Such a data type is abstract in the sense that it is independent of various concrete implementations Modularity refers to dividing a system into components or modules, each of which can be designed, implemented, tested, reasoned about, and reused separately from the rest of the system Using ADTs (abstract data types) has advantages for program modularity. The ability to define abstractions is an important skill for programmers to understand exactly what it means by abstraction and how it applies to programming. Abstract data types hide unnecessary details from the user (called information hiding), and they allow the program to break up the problem into smaller more manageable pieces. Following are advantages of ADTs for program modularity 1.) Abstraction: Abstraction is the process of trying to identify the most important or inherent qualities of an object or model, and ignoring or omitting the unimportant aspects. It brings to the forefront or highlights certain features, and hides other elements Abstraction is an important means of controlling complexity. When something is viewed at an abstract level only the most important features are being emphasized. The details that are omitted need not be remembered or even recognized. The user of an ADT doesn’t need to know or even understand any of the implementation details of the ADT, which reduces the complexity of the programming task. 2.) Localization of bugs: If there are bugs either in the representation or implementation of the ADT, the bugs are local to the ADT, and can’t be caused by code that uses the ADT.

3.) Localization of changes: If the programmer decides to change the representation of ADT (i.e., to change the representation of a set from a linked list to a stack or array), then only the implementation of the ADT need be changed; code that uses the type is not affected. 4.) Encapsulation An encapsulation is a packaging, placing items into a unit, or capsule. The key consequence of this process is that the encapsulation can be viewed in two ways, from the inside and from the outside. The outside view is often a description of the task being performed, while the inside view includes the implementation of the task. Encapsulation or “black boxing” ensures that data cannot be corrupted, and ensures that your code-base is free of errors 5.) Robustness Your programs will be robust and have the ability to catch errors and prevent exceptions

References Geeksforgeeks, (n.d). Abstract data types. Retrieved from https://www.geeksforgeeks.org/abstract-data-types/...


Similar Free PDFs