• Home /Exam Details (QP Included) / Main Exam / Optional Subject-Medical Group / Computer Science / Computer Science Notes – For W.B.C.S. Examination – Object Oriented Programming.
  • Computer Science Notes – For W.B.C.S. Examination – Object Oriented Programming.
    Posted on July 18th, 2019 in Computer Science
    Tags:

    Computer Science Notes – For W.B.C.S. Examination – Object Oriented Programming.

    কম্পিউটার সায়েন্স নোট – WBCS পরীক্ষা – অবজেক্ট ওরিয়েন্টেড প্রোগ্রামিং।

    • The object-oriented Programming course is designed to provide a comprehensive study of the C programming language. It stresses the strengths of C, which provide students with the means of writing efficient, maintainable and portable code. The nature of C language is emphasized in the wide variety of examples and applications. To learn and acquire the art of computer programming. To know about some popular programming languages and how to choose a Programming language for solving a problem.Continue Reading Computer Science Notes – For W.B.C.S. Examination – Object Oriented Programming.
    • Object-Oriented Programming (OOP) is the term used to describe a programming approach based on objects and classes. The object-oriented paradigm allows us to organise software as a collection of objects that consist of both data and behaviour. This is in contrast to conventional functional programming practice that only loosely connects data and behaviour.
    • Since the 1980s the word ‘object’ has appeared in relation to programming languages, with almost all languages developed since 1990 having object-oriented features. Some languages have even had object-oriented features retro-fitted. It is widely accepted that object-oriented programming is the most important and powerful way of creating software.
    • The object-oriented programming approach encourages:
      • Modularisation: where the application can be decomposed into modules.
      • Software re-use: where an application can be composed from existing and new modules.
    • An object-oriented programming language generally supports five main features:
      • Classes
      • Objects
      • Classification
      • Polymorphism
      • InheritanceIf we think of a real-world object, such as a television (as in Figure 1.1), it will have several features and properties:
        • We do not have to open the case to use it.
        • We have some controls to use it (buttons on the box, or a remote control).
        • We can still understand the concept of a television, even if it is connected to a DVD player.
        • It is complete when we purchase it, with any external requirements well documented.
          • States – (or data) are the values that the object has.
          • Methods – (or behaviour) are the ways in which the object can interact with its data, the actions.An object is an instance of a class. You could think of a class as the description of a concept, and an object as the realisation of this description to create an independent distinguishable entity. For example, in the case of the Television, the class is the set of plans (or blueprints) for a generic television, whereas a television object is the realisation of these plans into a real-world physical television. So there would be one set of plans (the class), but there could be thousands of real-world televisions (objects).Objects can be concrete (a real-world object, a file on a computer) or could be conceptual (such as a database structure) each with its own individual identity. Figure 1.3 shows an example where the Television class description is realised into several television objects. These objects should have their own identity and are independent from each other. For example, if the channel is changed on one television it will not change on the other televisions.

            Encapsulation

            The object-oriented paradigm encourages encapsulation. Encapsulation is used to hide the mechanics of the object, allowing the actual implementation of the object to be hidden, so that we don’t need to understand how the object works. All we need to understand is the interface that is provided for us.

            You can think of this in the case of the Television class, where the functionality of the television is hidden from us, but we are provided with a remote control, or set of controls for interacting with the television, providing a high level of abstraction. So, as in Figure 1.4 there is no requirement to understand how the signal is decoded from the aerial and converted into a picture to be displayed on the screen before you can use the television.

            There is a sub-set of functionality that the user is allowed to call, termed the interface. In the case of the television, this would be the functionality that we could use through the remote control or buttons on the front of the television.

            The full implemenation of a class is the sum of the public interface plus the private implementation.

          • \The TV will not crash!A class should:
            • Provide a well-defined interface – such as the remote control of the television.
            • Represent a clear concept – such as the concept of a television.
            • Be complete and well-documented – the television should have a plug and should have a manual that documents all features.
            • The code should be robust – it should not crash, like the television.

            With a functional programming language (like C) we would have the component parts of the television scattered everywhere and we would be responsible for making them work correctly – there would be no case surrounding the electronic components.

            Humans use class based descriptions all the time – what is a duck? (Think about this, we will discuss it soon.)

            Classes allow us a way to represent complex structures within a programming language. They have two components.

           

    Please subscribe here to get all future updates on this post/page/category/website

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

     WBCS Foundation Course Classroom Online 2024 2025 WBCS Preliminary Exam Mock Test WBCS Main Exam Mock Test WBCS Main Language Bengali English Nepali Hindi Descriptive Paper