Table of Contents
Introduction to Salesforce Apex
-
- What is Salesforce apex?
- Salesforce Apex is a programming language used to develop custom functionalities and business logic in the Salesforce platform. Think of it as a tool that allows developers to create custom solutions that are specific to a particular business’s needs within the Salesforce environment.
- Use of Salesforce apex
- With Salesforce Apex, developers can create custom objects, automate business processes, create custom user interfaces, and integrate Salesforce with other systems. In simple terms, Apex is a way to extend the capabilities of the Salesforce platform to meet the unique needs of a business.
- What is Salesforce apex?
OOPs Concept
-
- Object
- Class
- Abstraction
- Inheritance
- Polymorphism
- Encapsulation
What is an Object?
- Any real-world entity that has a state and behavior is known as an object. For example, a chair, pen, table, keyboard, bike, etc.
- It can be physical or logical.
- A Cat is an Object because it has color, height, and weight as state and speaks, walks, and sleeps as behavior
- A table or chair is also an object because it has color, height, width &, etc.
What is a Class
→ A-Class is a Collection of Objects is a class. For Example, Vehicles, Tree, Animal
→ Class can also be defined as a blueprint from which we can create multiple individual objects.
Abstraction (What the object does)
Hiding internal (implementation) details and exposing/showcasing only the functionality is known as abstraction.
For example tv, We do not what happens behind the scene
Inheritance
When a child object acquires all the properties (variables/methods) from a parent object then it is known as inheritance.
Polymorphism
When the same task is done in a different way then it is known as Polymorphism. For Example, speaking, walking, convincing customers, playing football, youtube sessions, teaching
Encapsulation (How the Object does)
Wrapping hiding/code (Putting together) and data together into a single unit is known as encapsulation.
For example, a capsule is wrapped with different medicines.
In Salesforce, class is a perfect example of encapsulation.
- DRY Principle
- Do not repeat yourself
- SOLID Principle (Intro)
-
- S – Single Responsibility Principle (SRP)
- O – Open-Closed Principle
- L – Liskov’s Substitution Principle
- I – Interface Segregation Principle
- D – Dependency Inversion Principle
Complete Video
Resources
- https://www.javatpoint.com/java-oops-concepts
- https://www.geeksforgeeks.org/object-oriented-programming-oops-concept-in-java/
- https://www.mygreatlearning.com/blog/oops-concepts-in-java/
- https://medium.com/from-the-scratch/oop-everything-you-need-to-know-about-object-oriented-programming-aee3c18e281b
- https://medium.com/edureka/object-oriented-programming-b29cfd50eca0
- https://medium.com/backticks-tildes/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898
