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
- OOPs Concepts in Java offer easy to understand and a clear modular structure for programs.
- Objects created for Object-Oriented Programs can be reused in other programs. Thus it saves significant development cost.
- Large programs are difficult to write, but if the development and designing team follow OOPS concepts, then they can better design with minimum flaws.
- It enhances program modularity because every object exists independently.
By : Harshal Lad
Comments
Post a Comment