Skip to main content

OOP,s Concepts in APEX

What is OOP's Concepts in APEX Programming ?

 

  • Object-Oriented Programming System (OOPs) is a programming concept that works on the principles of abstraction, encapsulation, inheritance, and polymorphism. It allows users to create objects they want and create methods to handle those objects. The basic concept of OOPs is to create objects, re-use them throughout the program, and manipulate these objects to get results.
  • OOP meaning “Object Oriented Programming” is a popularly known and widely used concept in modern programming languages like Java, Apex and many other.

List of OOP's Concepts

Class : The class is one of the Basic concepts of OOPs which is a group of similar entities. It is only a logical component and not the physical entity. Lets understand this one of the OOPs Concepts with example, if you had a class called “Expensive Cars” it could have objects like Mercedes, BMW, Toyota, etc. Its properties(data) can be price or speed of these cars. While the methods may be performed with these cars are driving, reverse, braking etc.

Object : An object can be defined as an instance of a class, and there can be multiple instances of a class in a program. An Object is one of the Apex OOPs concepts which contains both the data and the function, which operates on the data. For example – chair, bike, marker, pen, table, car, etc.

> Inheritance : Inheritance is one of the Basic Concepts of OOPs in which one object acquires the properties and behaviors of the parent object. It’s creating a parent-child relationship between two classes. It offers robust and natural mechanism for organizing and structure of any software.

Polymorphism : Polymorphism refers to one of the OOPs concepts in Apex which is the ability of a variable, object or function to take on multiple forms. For example, in English, the verb run has a different meaning if you use it with a laptop, a foot race, and business. Here, we understand the meaning of run based on the other words used along with it. The same also applied to Polymorphism.

Encapsulation : Encapsulation is one of the best Apex OOPs concepts of wrapping the data and code. In this OOPs concept, the variables of a class are always hidden from other classes. It can only be accessed using the methods of their current class. For example – in school, a student cannot exist without a class.

Abstraction : Hiding internal complexity and showing functionality is known as abstraction. For example: Car Drive, we don’t know the internal processing. It is also used to provide the set of guidelines for development. In apex, we use abstract class and interface to achieve the abstraction.


Advantages of OOP's Programming

  1. OOPs Concepts in Java offer easy to understand and a clear modular structure for programs.
  2. Objects created for Object-Oriented Programs can be reused in other programs. Thus it saves significant development cost.
  3. Large programs are difficult to write, but if the development and designing team follow OOPS concepts, then they can better design with minimum flaws.
  4. It enhances program modularity because every object exists independently.


By : Harshal Lad 

Comments

Popular posts from this blog

Salesforce Development Index

C ourse C ontent Declarative Features Vs Programmatic Features Salesforce Architecture ( MVC ) Data Types Apex Classes If – Conditional and loops Collections in APEX List Set Map Oops Concepts Inheritance Polymorphism Encapsulation Abstraction Data Manipulation Language (SOQL) & SOSL Exception Handling Triggers and its Best Practices Custom Setting, Custom Metadata and Custom Labels Where to use it ? How to use it ? Apex Trigger + Custom Setting Asynchronous Apex Batch Classes Scheduler Classes Queueable Classes Future Method Apex Governor Limits Test Classes for Triggers and Apex classes Visualforce Pages Standard Controllers Extension Controllers Custom Controllers Wrappers Classes in Apex By : Harshal Lad ( CorpoVision Te...

Opportunities at Paidwork Company

Unveiling the Potential of Paidwork Company : Unlocking Earning Methods, Referral Programs, and Achievements In the ever-evolving landscape of remote work and freelancing, Paidwork has emerged as a noteworthy platform that not only offers a diverse range of earning methods but also provides users with unique opportunities for growth and recognition. This article will delve into the intricacies of Paidwork, exploring its earning methods, referral program, and the benefits of achieving milestones on the platform. Go to Paidwork Website 1. Earning Methods on Paidwork: Paidwork provides freelancers and remote workers with various avenues to earn money, catering to a wide range of skills and expertise. The primary earning methods on Paidwork include: a. Freelance Projects: Users can browse through a plethora of freelance projects posted on Paidwork. From graphic design and content creation to software development and digital marketing, the platform hosts diverse opportunities for indi...

Apex Triggers and Classes

  Apex Triggers   is use to execute the functionality or piece of code on record manipulation ( i.e., CREATE / UPDATE / DELETE / UNDELETE   records ). A trigger executes before and after an event occurs on record.