Data Hiding and Encapsulation
Enhanced Definition
In the mainframe context, data hiding and encapsulation refer to the principle of structuring programs and systems such that the internal implementation details and data structures of a component are concealed from other components. This promotes modularity by requiring external components to interact only through well-defined interfaces, thereby reducing interdependencies and enhancing maintainability.
Key Characteristics
-
- Modular Design: Achieved through the use of separate COBOL subprograms, CICS programs, or JCL procedures, each with a specific function and limited scope.
- Controlled Access: Data is accessed or modified only through designated interfaces (e.g., program parameters,
COMMAREAs in CICS, database views), preventing direct manipulation of internal data. - Reduced Coupling: Components have minimal knowledge of each other's internal workings, making it easier to modify one component without affecting others.
- Information Hiding: The internal logic, data structures, and algorithms within a program or module are not exposed to external callers.
- Interface-Based Interaction: Components communicate exclusively via defined interfaces, such as
LINKAGE SECTIONparameters in COBOL orEXEC CICS LINKwithCOMMAREA.
Use Cases
-
- COBOL Subprograms: A main COBOL program calls a subprogram to perform a specific calculation or data manipulation, passing necessary data via the
LINKAGE SECTIONand receiving results, without needing to know the subprogram's internalWORKING-STORAGEor logic. - CICS Transaction Programs: A CICS program processes a user request, potentially linking to other CICS programs or subroutines. Data is passed via the
COMMAREA, ensuring that the called programs' internal states are not directly exposed. - JCL Procedures (PROCs): A JCL
PROCencapsulates a sequence of job steps andDDstatements. Users invoke thePROCand pass parameters viaPARMorSETstatements, without needing to understand the intricate details of each step within thePROC. - Database Views: Defining a
VIEWin DB2 allows users or applications to access a subset of columns or rows from one or more tables, effectively hiding the underlying table structure and complexity. - System Services: z/OS system services (e.g., I/O routines, memory management) expose well-defined APIs (e
- COBOL Subprograms: A main COBOL program calls a subprogram to perform a specific calculation or data manipulation, passing necessary data via the
Related Products
Related Vendors
Applied Software
7 products
Related Categories
Encryption
41 products
Files and Datasets
168 products