Programming Basics

Object Oriented Programming

Programming Basics

Amongst other things, objects in programming can be used to model objects from the real world. Since programs are designed to work and be used in the real world, it helps to be able to mirror reality, using objects is a useful way of grouping together details.

Abstraction

Abstraction serves to hide the complex mechanisms within an object, leaving only the information that we need in order to interact with it.

Summary

  • Objects can be designed to model real-world things in software.
  • Objects group together details.
  • Abstraction means showing only what’s relevant and useful for the person using it.
  • By hiding all the inner workings of a given object with abstraction, we are able to reduce their apparent complexity.
  • A plan or blueprint for an object is called a class.
  • A class defines the attributes (a description), the methods (what it does), and the access level (who can use it) for an object.
  • To create an object, you have to instantiate it. An instantiated object is called an instance of a class.
  • Objects from the same class can differ in the details if they have different values for their attributes. They still have to follow the class plan, though!
  • Encapsulation is the bundling together of attributes, methods, and access control in order to protect an object.
  • When an object A can interact with a related object B, we say that object A contains object B and is therefore able to send it a message.
  • Objects can have attributes that are objects. These objects also have their own independent blueprint (class), attributes, behaviors, and access.
  • Objects communicate with one another by sending messages.
  • Associating objects with other objects allows you to more easily adapt and make changes to your system.

Test your knowledge on OOPS concepts by taking this quiz , Be honest guys :)

Did you find this article valuable?

Support Manish Bannur by becoming a sponsor. Any amount is appreciated!