O'Reilly logo

Visualforce Developer's Guide by W.A.Chamil Madusanka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Considerations for creating custom controllers and controller extensions

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 sharing and with sharing respectively. Sensitive data can be exposed without sharing controllers.
  • The webservice methods 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 implement Data Manipulation Language (DML) in the constructor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required