When you are creating custom controllers and controller extensions, keep the following consideration in mind:
- The most important thing to keep in your mind is Apex governor limits.
- Apex classes can be run in the system mode and user mode by using
without sharingandwith sharingrespectively. Sensitive data can be exposed without sharing controllers. - The
webservicemethods must be defined as global. All other methods are public. - Try to access the database in less time by using sets, maps, or lists. This will increase the efficiency of your code.
- Apex methods and variables are not instantiated in a guaranteed order.
- You cannot define the
@futureannotation for any getter method, setter method, or constructor method of a controller. - Primitive data types (String, Integer, and so on) are passed by value and non-primitive Apex data types (list, maps, set, sObject, and so on) are passed by the reference to a component's controller.
Comments
Post a Comment