Modernization Hub

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 SECTION parameters in COBOL or EXEC CICS LINK with COMMAREA.

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 SECTION and receiving results, without needing to know the subprogram's internal WORKING-STORAGE or 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 PROC encapsulates a sequence of job steps and DD statements. Users invoke the PROC and pass parameters via PARM or SET statements, without needing to understand the intricate details of each step within the PROC.
    • Database Views: Defining a VIEW in 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

Related Vendors

Applied Software

7 products

Related Categories

Encryption

41 products

Files and Datasets

168 products