Object-Oriented CIS 3100

Building this would indicate that object house

Info icon This preview shows pages 4–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Building” this would indicate that object “House” inherits from object “Building”. The House object has all of the properties and methods of the Building object, general items like “roof”, “walls”, and “rooms” and also its own special items like “bedroom”, “kitchen”, and “furniture”. Note that the members of an object can be objects themselves. Abstraction Abstraction refers to hiding the actual implementation of an object’s method from the users of that object. For instance, it is of no consequence to the user of an object how the method performs its necessary instructions, nor should we provide this information to users as it would most likely confuse them. The cornerstone of abstraction is the ability of an object to have data that is private to itself, data that only the object itself can modify or even knows that it exists. Polymorphism Polymorphism is a concept related to inheritance. Polymorphism literally translated means “many faces.” This concept is exemplified by the parent – child relationship property “a child can be used where a parent is expected.” What this means is that if we have objects of different types such as dog and cat child objects and a parent object animal all with methods for speak and we place these objects in a list and at some point call the speak method we do not have to explicitly indicate which object we are dealing with. The compiler will determine at run-time whether the object is of type dog, cat or animal and call the correct speak method. This is a particularly useful concept that is used in many places within object- oriented programs. For instance the “+” operator can indicate two very different instructions based upon the operands. If the operands are numeric then it indicates mathematical additions, but in many languages if the operands are strings or literals it indicates concatenation. Encapsulation Encapsulation is the principle of placing all the necessary data for an object in the same place as any methods used to manipulate the object. This is used to ensure that a programmer has all the necessary information regarding an object in the most convenient place to reduce the number of errors and difficulty of maintaining the code once in production. COBOL 2002 Standards The latest revision to the ANSI COBOL standards, referred to as COBOL 2002, provides the necessary keywords and changes to allow programmers to create object-oriented COBOL
Image of page 4

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
code. It also adds several significant improvements that help COBOL continue to be the most used programming language on the planet. Let’s look at a few of the updates. Updates Exciting updates to COBOL included in the 2002 standards allow COBOL functions to be called recursively. This adds to the flexibility of the language and also makes the use of more complex and efficient algorithms possible. Other updates include: A Boolean datatype, inline comment special character “*>”, compiler directive for free format, common exception handling, file sharing and record locking, support for XML parsing and generation, and of course keywords and mechanisms necessary for object orientation [6] .
Image of page 5
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern