180 likes | 221 Views
Object-Oriented COBOL?. Senior Seminar Sp. 2007 Trevor Simpson. Object-Oriented COBOL?. Why the “?” Isn’t COBOL dead. COBOL = Lazarus. Created in 1959 First standard finalized by ANSI in 1960 Latest of 4 major revisions is COBOL 2002. COBOL Background. Procedural Language
E N D
Object-Oriented COBOL? Senior Seminar Sp. 2007 Trevor Simpson
Object-Oriented COBOL? • Why the “?” • Isn’t COBOL dead
COBOL = Lazarus • Created in 1959 • First standard finalized by ANSI in 1960 • Latest of 4 major revisions is COBOL 2002
COBOL Background • Procedural Language • Tightly Structured • Strongly Typed • Extremely Stable • Highly Secure • Batch Processing
Like a recipe Everything done in order Functions Modules Call Variable Like life Different “objects” interacting Methods Objects Message Member Procedural vs. Object-Oriented
The Object-Oriented Paradigm • 4 main tenets • Inheritance • Dog IS A Animal • Abstraction • Hide details of implementation • Polymorphism • Determine exact method implementation at run-time • I.e. method or operator overloading • Encapsulation • Data and Methods in ONE location
ANSI 85 Standard COBOL • Columnar Restrictions • Cols. 1-6 Reserved for sequence #’s • Col. 7 Reserved for special character • Cols. 8-72 usable, anything beyond 72 ignored • Other restrictions on where Names and Type definitions can start
ANSI 85 Standard COBOL • 4 Divisions • Identification Division • Environment Division • Data Division • Procedure Division
ANSI 85 COBOL Example • Assign2.CBL • Report
ANSI 2002 COBOL Standard • Latest Revision Adds Several Features • Boolean Data Type • Recursion • Compiler Directive for Free Format • Inline Comment “*>” • Support for Object Oriented Paradigm
2002 COBOL OO Elements • Factory • Basically a separate set of code used to handle general object tasks. • Class, Object Keywords • Interfaces • Inherits Keyword • Parameterized Classes (Like a Java Interface Class)
2002 COBOL OO Elements • Usage Object Reference Clause • Perhaps most powerful OO element added • Allows dataname to be a reference(pointer) • Call Object Handles • Dataname can be set to refer to a specific object type or be set to universal
OO COBOL Examples • DriverStudent • COBOL with VB GUI • COBOL Using XML
COBOL’s Future • Estimates as high as 200 Billion lines of code • New standard creation underway for release in 2008. • Add support for specific collection classes • SortedCollections • KeyedCollections • OrderedCollections • Even touted as better way to learn OO principles
References • Arranga, Edmund C. (1996). Object-Oriented COBOL. New York : SIGS Books & Multimedia • COBOL Standards. (n.d.) Various pages from www.cobolstandards.com • Flint, E. S. (1997). The COBOL jigsaw puzzle: fitting object-oriented and legacy applications together. IBM Systems Journal, 36(1), pp 49-65. Retrieved March 10, 2007 from Wilson Database. • Glass, Robert L. (1997). Cobol--a contradiction and an enigma. Association for Computing Machinery. Communications of the ACM 40(9) pp 11-14. Retrieved March 3, 2007 from ABI/Inform Database. • Hardgrave, Bill C. (Mar/Apr 2000). Cobol in an Object-Oriented World: A Learning Perspective. IEEE Software, 17(2), pp 26. Retrieved March 10, 2007 from Academic Search Elite Database. • Native COBOL Syntax for XML Support. (Mar 30, 2006). WG4 N0248 TDR24716. Retrieved March 20, 2007 from http://www.cobolstandard.info/wg4/document.html • Sammet, Jean E. (1985). Brief Summary of the Early History of COBOL. Annals of the History of Computing 7(4) pp 288. Retrieved March 3, 2007 from ABI/Inform Database. • Sokol, Marc. (1990). Reader Viewpoint: Why 4GLs Cannot Kill COBOL. Journal of Systems Management, 41(5) pp 35-37. Retrieved March 13, 2007 from ABI/Inform Database.