Table of Contents
IBM Enterprise COBOL for z/OS - Communicating with Java methods
Return to IBM Enterprise COBOL for z/OS - Communicating with Java methods
ISO COBOL-2023, COBOL, Effective Java, COBOL for z/OS (https://www.ibm.com/docs/en/cobol-zos/6.4?topic=programs-writing-object-oriented), https://www.microfocus.com/documentation/visual-cobol/VC40/Intro_to_OO_Programming_for_COBOL_Developers.pdf
- Visual COBOL - Object-Oriented Programming for COBOL - Object-Oriented COBOL - https://www.microfocus.com/documentation/visual-cobol/vc50/VS2019/GUID-A80CA9E8-7B68-4637-91E9-42078C8C9275.html - Managed COBOL is the collective term for JVM COBOLand dot NET COBOL | .NET COBOL. Managed COBOL is regular procedural COBOL with extensions to take advantage of the features of the managed frameworks. This includes COBOL object-oriented (COBOL OOP - OOP COBOL) syntax that allows access to large libraries of functionality you can use in your COBOL application, and much more. To take full advantage of Managed COBOL, it is helpful to understand the object oriented COBOL concepts. See also: https://cobol.ninja/object-oriented-cobol
Return to Effective Polyglot Programming by Cloud Monk, ISO COBOL-2023, CPP Core Guidelines (CG) by Bjarne Stroustrup and Herb Sutter | C++ Core Guidelines (CG) by Bjarne Stroustrup and Herb Sutter, CPP | C++, Effective Java, Effective Spring Boot, Effective Scala, Effective Kotlin, Effective CPP | Effective C++, Effective Swift, Effective TypeScript, Effective JavaScript, Effective PHP, Effective Golang, Effective Rust, Effective C Language, Effective Clojure, Effective Haskell, Effective Elixir, Effective Erlang, Effective Elm, Effective PowerShell, Effective F Sharp, Effective Dart, Effective R Language, Effective Ruby, Effective Julia, Effective Fortran
Have The Borg rewrite Effective Java for COBOL-2023 as Effective COBOL-2023
See:
- Writing object-oriented COBOL programs - https://www.ibm.com/docs/en/cobol-zos/6.4?topic=programs-writing-object-oriented
- When you write an object-oriented (OO) program, you have to determine what classes you need and the methods and data that the classes need to do their work.
- Communicating with Java methods - https://www.ibm.com/docs/en/cobol-zos/6.4?topic=programs-communicating-java-methods
- To achieve COBOL interoperability with Java, you need to follow certain rules and guidelines for using services in the Java Native Interface (JNI), coding data types, and compiling COBOL programs.
Effective IBM Object-Oriented Enterprise COBOL for z/OS - Table of Contents
Inspired by and Based on Effective Java, Third Edition by Joshua Bloch, Pearson Education Inc., 2018, ISBN-13: 978-0-13-468599-1, ISBN-10: 0-13-468599-7
Contents
Foreword
Preface
Acknowledgments
1 Introduction
2 Creating and Destroying Objects
3 Methods Common to All Objects
4 Classes and Interfaces
5 Generics
6 Enums and Annotations
7 Lambdas and Streams
8 Methods
9 General Programming
10 Exceptions
11 Concurrency
12 Serialization
Items Corresponding to Second Edition
References
Index
Appendix: Items Corresponding to Second Edition
Second Edition Item Number
Third Edition Item Number, Title
1
1, Consider static factory methods instead of constructors
2
2, Consider a builder when faced with many constructor parameters
3
3, Enforce the singleton property with a private constructor or an enum type
4
4, Enforce noninstantiability with a private constructor
5
6, Avoid creating unnecessary objects
6
7, Eliminate obsolete object references
7
8, Avoid finalizers and cleaners
8
10, Obey the general contract when overriding equals
9
11, Always override hashCode when you override equals
10
12, Always override toString
11
13, Override clone judiciously
12
14, Consider implementing Comparable
13
15, Minimize the accessibility of classes and members
14
16, In public classes, use accessor methods, not public fields
15
17, Minimize mutability
16
18, Favor composition over inheritance
17
19, Design and document for inheritance or else prohibit it
18
20, Prefer interfaces to abstract classes
19
22, Use interfaces only to define types
20
23, Prefer class hierarchies to tagged classes
21
42, Prefer lambdas to anonymous classes
22
24, Favor static member classes over nonstatic
23
26, Don’t use raw types
24
27, Eliminate unchecked warnings
25
28, Prefer lists to arrays
26
29, Favor generic types
27
30, Favor generic methods
28
31, Use bounded wildcards to increase API flexibility
29
33, Consider typesafe heterogeneous containers
30
34, Use enums instead of int constants
31
35, Use instance fields instead of ordinals
32
36, Use EnumSet instead of bit fields
33
37, Use EnumMap instead of ordinal indexing
34
38, Emulate extensible enums with interfaces
35
39, Prefer annotations to naming patterns
36
40, Consistently use the Override annotation
37
41, Use marker interfaces to define types
38
49, Check parameters for validity
39
50, Make defensive copies when needed
40
51, Design method signatures carefully
41
52, Use overloading judiciously
42
53, Use varargs judiciously
43
54, Return empty collections or arrays, not nulls
44
56, Write doc comments for all exposed API elements
45
57, Minimize the scope of local variables
46
58, Prefer for-each loops to traditional for loops
47
59, Know and use the libraries
48
60, Avoid float and double if exact answers are required
49
61, Prefer primitive types to boxed primitives
50
62, Avoid strings where other types are more appropriate
51
63, Beware the performance of string concatenation
52
64, Refer to objects by their interfaces
53
65, Prefer interfaces to reflection
54
66, Use native methods judiciously
55
67, Optimize judiciously
56
68, Adhere to generally accepted naming conventions
57
69, Use exceptions only for exceptional conditions
58
70, Use checked exceptions for recoverable conditions and runtime exceptions for programming errors
59
71, Avoid unnecessary use of checked exceptions
60
72, Favor the use of standard exceptions
61
73, Throw exceptions appropriate to the abstraction
62
74, Document all exceptions thrown by each method
63
75, Include failure-capture information in detail messages
64
76, Strive for failure atomicity
65
77, Don’t ignore exceptions
66
78, Synchronize access to shared mutable data
67
79, Avoid excessive synchronization
68
80, Prefer executors, tasks, and streams to threads
69
81, Prefer concurrency utilities to wait and notify
70
82, Document thread safety
71
83, Use lazy initialization judiciously
72
84, Don’t depend on the thread scheduler
73
(Retired)
74
85, Prefer alternatives to COBOL 2023 serialization
86, Implement Serializable with great caution
75
85, Prefer alternatives to COBOL 2023 serialization
87, Consider using a custom serialized form
76
85, Prefer alternatives to COBOL 2023 serialization
88, Write readObject methods defensively
77
85, Prefer alternatives to COBOL 2023 serialization
89, For instance control, prefer enum types to readResolve
78
85, Prefer alternatives to COBOL 2023 serialization
90, Consider serialization proxies instead of serialized instances
COBOL Programming Language, COBOL Source File, COBOL .cbl File Extension, COBOL .cob File Extension, COBOL .cobol File Extension, COBOL Compiler, COBOL Compilation Unit, COBOL Run-time System, COBOL Environment Division, COBOL Identification Division, COBOL Procedure Division, COBOL Data Division, COBOL Configuration Section, COBOL Input-Output Section, COBOL File-Control Paragraph, COBOL I-O Control Paragraph, COBOL File Section, COBOL Working-Storage Section, COBOL Local-Storage Section, COBOL Linkage Section, COBOL Communication Section, COBOL Report Section, COBOL FD Entry (File Descriptor), COBOL SD Entry (Sort Descriptor), COBOL SELECT Statement, COBOL ASSIGN Clause, COBOL ORGANIZATION Clause, COBOL ACCESS MODE, COBOL SEQUENTIAL Access, COBOL RELATIVE Access, COBOL INDEXED Access, COBOL RECORD KEY Clause, COBOL ALTERNATE KEY Clause, COBOL DYNAMIC Access Mode, COBOL RANDOM Access Mode, COBOL KEY IS Clause, COBOL LINAGE Clause, COBOL BLOCK CONTAINS Clause, COBOL RECORD CONTAINS Clause, COBOL RECORDING MODE Clause, COBOL LABEL RECORDS Clause, COBOL CODE-SET Clause, COBOL FILE STATUS Clause, COBOL FD (File Description) Entry, COBOL FILE SECTION Variables, COBOL WORKING-STORAGE Variables, COBOL 01 Level Number, COBOL 77 Level Number, COBOL 66 Level Number, COBOL 88 Level Number (Condition Names), COBOL PIC Clause (Picture), COBOL USAGE Clause, COBOL DISPLAY Usage, COBOL COMP Usage, COBOL COMP-3 (Packed Decimal), COBOL COMP-1 (Floating Point) , COBOL COMP-2 (Floating Double) , COBOL COMP-4 Equivalent to COMP, COBOL COMP-5 (Native Binary) , COBOL SIGN SEPARATE Clause, COBOL SIGN TRAILING Clause, COBOL JUSTIFIED RIGHT Clause, COBOL SYNCHRONIZED Clause, COBOL OCCURS Clause, COBOL OCCURS DEPENDING ON Clause, COBOL REDEFINES Clause, COBOL RENAMES Clause, COBOL VALUE Clause, COBOL VALUE IS Clause, COBOL FILLER Keyword, COBOL ACCEPT Statement, COBOL DISPLAY Statement, COBOL MOVE Statement, COBOL ADD Statement, COBOL SUBTRACT Statement, COBOL MULTIPLY Statement, COBOL DIVIDE Statement, COBOL COMPUTE Statement, COBOL INITIALIZE Statement, COBOL STRING Statement, COBOL UNSTRING Statement, COBOL INSPECT Statement, COBOL PERFORM Statement, COBOL PERFORM UNTIL, COBOL PERFORM VARYING, COBOL PERFORM THRU, COBOL EXIT Statement, COBOL STOP RUN Statement, COBOL GOBACK Statement, COBOL EVALUATE Statement, COBOL WHEN Clause (EVALUATE), COBOL CONTINUE Statement, COBOL NEXT SENTENCE Statement, COBOL IF Statement, COBOL ELSE Clause, COBOL END-IF Statement, COBOL GO TO Statement, COBOL ALTER Statement (Obsolete), COBOL SORT Statement, COBOL MERGE Statement, COBOL RELEASE Statement (for SORT), COBOL RETURN Statement (for SORT), COBOL SEARCH Statement, COBOL SEARCH ALL (Binary Search), COBOL CALL Statement, COBOL CANCEL Statement, COBOL LINKAGE SECTION Variables, COBOL USING Clause (in Procedure Division), COBOL EXIT PROGRAM Statement, COBOL ENTRY Statement (Obsolete), COBOL COPY Statement, COBOL REPLACE Directive, COBOL EJECT Directive, COBOL SKIP Directive, COBOL SERVICE RELOAD (IBM Extension, COBOL INTRINSIC FUNCTIONS, COBOL FUNCTION Keyword, COBOL CURRENT-DATE Function, COBOL NUMVAL Function, COBOL NUMVAL-C Function, COBOL WHEN-COMPILED Function, COBOL RANDOM Function, COBOL REM Function, COBOL LENGTH Function, COBOL MAX Function, COBOL MIN Function, COBOL MOD Function, COBOL SUBSTRING Function, COBOL UPPER-CASE Function, COBOL LOWER-CASE Function, COBOL NATIONAL-OF Function, COBOL DISPLAY-OF Function, COBOL TEST Function (in some compilers, COBOL EXAMINE Statement (Old name of INSPECT), COBOL CLASS Condition, COBOL ALPHABETIC Class Condition, COBOL ALPHANUMERIC Class Condition, COBOL NUMERIC Class Condition, COBOL JUSTIFIED Clause (in PIC), COBOL SYNCHRONIZED Clause repeated, COBOL ON SIZE ERROR Clause, COBOL ON OVERFLOW Clause, COBOL ON EXCEPTION Clause, COBOL INVALID KEY Clause, COBOL END-ADD Statement (in COBOL 2002+, COBOL END-SUBTRACT Statement, COBOL END-MULTIPLY Statement, COBOL END-DIVIDE Statement, COBOL END-COMPUTE Statement, COBOL END-PERFORM Statement, COBOL END-READ Statement, COBOL END-WRITE Statement, COBOL END-REWRITE Statement, COBOL END-DELETE Statement, COBOL END-RETURN Statement, COBOL END-SEARCH Statement, COBOL END-IF repeated, COBOL END-STRING Statement, COBOL END-UNSTRING Statement, COBOL END-INSPECT Statement, COBOL END-ACCEPT Statement, COBOL END-DISPLAY Statement, COBOL In-Line PERFORM, COBOL Nested Programs, COBOL END PROGRAM Header, COBOL CALL BY CONTENT, COBOL CALL BY REFERENCE, COBOL CALL BY VALUE, COBOL INITIAL Program Attribute, COBOL RECURSIVE Program Attribute, COBOL EXPORT and IMPORT (Some compilers support, COBOL ENTRY POINTS in Program, COBOL Debugging Lines (D in col 7), COBOL Comment Lines (*) in col 7, COBOL Continuation Lines (- in col 7), COBOL Fixed Format Source Columns, COBOL Column 7 Indicators, COBOL Column 72 Limit, COBOL Free Format (COBOL 2002+) , COBOL *CONTROL Compiler Directive, COBOL *CBL Compiler Directive, COBOL $ SET Compiler Directive (IBM), COBOL ADV Compiler Option, COBOL SSRANGE Compiler Option, COBOL APOST Compiler Option, COBOL RENT Compiler Option, COBOL MAP Compiler Option, COBOL OPTIMIZE Compiler Option, COBOL NOOPTIMIZE Compiler Option, COBOL INSPECT TALLYING, COBOL INSPECT REPLACING, COBOL INSPECT CONVERTING, COBOL STRING DELIMITED BY, COBOL UNSTRING DELIMITED BY, COBOL POINTER IN STRING/UNSTRING, COBOL SUBScripting Arrays (OCCURS), COBOL OCCURS Depending On Variables, COBOL Table Handling, COBOL SEARCH VERB, COBOL SEARCH ALL VERB, COBOL SORT VERB, COBOL MERGE VERB, COBOL USE FOR DEBUGGING ON Statement, COBOL USE Global Declarative, COBOL DECLARATIVES Section, COBOL END DECLARATIVES, COBOL FILE STATUS Checking, COBOL EXTEND MODE for files, COBOL REWRITE Statement, COBOL DELETE Statement (for indexed files), COBOL START Statement (indexed file positioning), COBOL READ NEXT, COBOL READ PREVIOUS (not standard widely COBOL READ KEY Is Clause, COBOL WRITE FROM Clause, COBOL WRITE ADVANCING PAGE, COBOL WRITE AFTER ADVANCING LINES, COBOL WRITE BEFORE ADVANCING, COBOL Page-Controlled Reports (REPORT SECTION), COBOL Report Writer Feature (Obsolete in some implementations), COBOL RH, PH, PF, DE, etc. in REPORT)], [[COBOL SPECIAL-NAMES Paragraph, COBOL DECIMAL-POINT IS COMMA, COBOL CURRENCY SIGN Clause, COBOL CLASS Alphabet Name Definition, COBOL SYMBOLIC CHARACTERS, COBOL CRT STATUS Phrase (Old terminals), COBOL ADVANCING Control in WRITE, COBOL Nonnumeric Literals, COBOL Numeric Literals, COBOL PICTURE Clause (PIC), COBOL PIC 9 for digits, COBOL PIC X for alphanumeric, COBOL PIC A for alphabetic, COBOL PIC S for sign, COBOL PIC V for implied decimal, COBOL PIC P for scaling position, COBOL JUSTIFIED RIGHT Clause in PIC, COBOL BLANK WHEN ZERO Clause, COBOL ZERO SUPPRESSION, COBOL SIGN LEADING SEPARATE, COBOL SIGN TRAILING SEPARATE, COBOL USING in PROCEDURE DIVISION, COBOL GIVING/RETURNING in CALL, COBOL CANCEL Program, COBOL LINKAGE SECTION Parameters, COBOL EXTERNAL Name Clause, COBOL GLOBAL Clause for Data, COBOL COMMON Data, COBOL INITIAL Clause on Programs, COBOL IDENTIFICATION DIVISION PROGRAM-ID, COBOL AUTHOR Paragraph, COBOL INSTALLATION Paragraph, COBOL DATE-WRITTEN Paragraph, COBOL DATE-COMPILED Paragraph, COBOL SECURITY Paragraph, COBOL REMARKS Paragraph (Obsolete), COBOL Class Condition Checks, COBOL Condition-Names (88 Level), COBOL LEVEL 88 Definition, COBOL SET condition-name TO TRUE, COBOL SET condition-name TO FALSE, COBOL SET variable TO value, COBOL SET ... UP/DOWN BY value (for indexes), COBOL ACCEPT FROM DATE, COBOL ACCEPT FROM DAY, COBOL ACCEPT FROM DAY-OF-WEEK, COBOL ACCEPT FROM TIME, COBOL ACCEPT FROM COMMAND-LINE (Extension, COBOL ACCEPT FROM ENVIRONMENT (Extension, COBOL DISPLAY UPON], [COBOL DISPLAY WITH NO ADVANCING, COBOL READY TRACE (Obsolete Debug feature), COBOL USE AFTER ERROR Declarative, COBOL USE AFTER EXCEPTION Declarative, COBOL USE AFTER STANDARD Declarative, COBOL EXIT PARAGRAPH Statement, COBOL EXIT Perform CYCLE, COBOL EXIT Perform Loop
COBOL: Effective IBM Enterprise COBOL, Object-Oriented Programming for COBOL - Object-Oriented COBOL, COBOL Best Practices, COBOL FAQ, COBOL Standards (ISO COBOL-2023 - ISO/IEC 1989-2023 Standard), IBM Enterprise COBOL for z/OS, Deprecated / Defunct Micro Focus Visual COBOL - Visual COBOL - Managed COBOL from Micro Focus (JVM COBOL and dot NET COBOL | NET COBOL), COBOL Fundamentals, COBOL Inventor - COBOL Language Designer: 1959 by Howard Bromberg COBOL | Howard Bromberg, Norman Discount COBOL | Norman Discount, Vernon Reeves COBOL | Vernon Reeves, Jean E. Sammet, William Selden COBOL | William Selden, Gertrude Tierney COBOL | Gertrude Tierney, with indirect influence from Grace Hopper, CODASYL, ANSI COBOL, ISO/IEC COBOL; Modern COBOL - Legacy COBOL, IBM COBOL, COBOL keywords, COBOL data structures - COBOL algorithms, COBOL syntax, Visual COBOL, COBOL on Windows, COBOL on Linux, COBOL on UNIX, COBOL on macOS, Mainframe COBOL, IBM i COBOL, IBM Mainframe DevOps, COBOL Paradigms (Imperative COBOL, Procedural COBOL, Object-Oriented COBOL - COBOL OOP, Functional COBOL), COBOL syntax, COBOL installation, COBOL containerization, COBOL configuration, COBOL compilers, COBOL IDEs, COBOL development tools, COBOL DevOps - COBOL SRE, COBOL data science - COBOL DataOps, COBOL machine learning, COBOL deep learning, COBOL concurrency, COBOL history, COBOL bibliography, COBOL Glossary - Glossaire de COBOL - French, COBOL topics, COBOL courses, COBOL Standard Library, COBOL libraries, COBOL frameworks, COBOL research, Grace Hopper, COBOL GitHub, Written in COBOL, COBOL popularity, COBOL Awesome list, COBOL Versions. (navbar_cobol - see also navbar_mainframe, navbar_fortran)
Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.