Object Orientated Programming Flashcards
Describe the concept of data abstraction
The process where an object only offers the essential information to the outside world, and hides the background information. It essentially acts as a black box system.
Describe the concept of encapsulation
An objects data is encapsulated within its methods, protecting it and ensuring it remains uncorrupted.
Describe the concept of inheritance
In object orientated programming code can be reused by creating new classes using existing ones as templates. The new class will have the all the fields, and access to the same methods, as it’s ancestor. Additional fields and methods can be added to the new class.
Describe the concept of polymorphism
The ability to us an operator or function in different ways.
Describe the concept of overloading
When an existing operator or function is made to work on a new data type. A form of polymorphism.
Describe dynamic binding
Also called late binding, the process of connecting one program to another, that is to be executed after the call.
What is the difference between an object and a class?
A class is a blueprint containing the data fields and methods, but no data. An object is an instance of the class and contains data. It has access to the methods of the class, but does not contain copies of these.
What is MVC
Model-View-Controller, a framework for developing programs with user interfaces. It divides the code into 3 interconnected parts.
What is the model part of the MVC framework?
The model is the central component of the MVC system, and contains the application data, business rules, logic, and functions. The model should inform associated views and controllers when there are changes to the data.
What is the view part of the MVC framework?
The view is any representation of the data show to the end user. It requests information from the model to generate displays.
What is the controller part of the MVC framework?
The controller accepts inputs from the user and converts them into commands for the model or view.
What does CRUD stand for?
Create Read Update Delete are the 4 basic functions of persistent storage. In SQL this translates into PUT/POST, GET, PUT/PATCH, and DELETE
How do you add a comment line to Ruby code?
Use the #