You need to sign in to do that
Don't have an account?
surya bhai
what use of extensions in custom controller
i have one doubt custom controller have many methods if u want custome business logic we can define extra method in custom controller
why are useing the extensions, when we use extentions in custom controller please let me know help me.....
lets say if u have multiple vf pages using the same custom controller , and one vf page needs some extra logic , instaed of changing the controller we can can use extension for that vf page
All Answers
If you are not using standardController, then you can specify your controller name using Controller. But if you want to use standardController and also want to use custom controller then you have to give your custom controller name using "extensions".
This is what I think about it, with custom controller, you can have a base class-custom controller that has all of the common functioality and is shared across your team. Depending on your particular need, you write an extension. I don't add to custom controllers, as I don't want other developers to have to load a 3000 line custom controller just to use one of it's methods.
A more advanced usecase would be to use with sharing on custom controller and without sharing on extension to execute part of logic in system context. (only true for custom controller extensions)
Personally, I think the reason why we don't add to the custom controller itself is a matter of good software design and depends on the team/use case etc.
Sorry if I misunderstood your question.
Saraag.
lets say if u have multiple vf pages using the same custom controller , and one vf page needs some extra logic , instaed of changing the controller we can can use extension for that vf page
Hi,
ok fine but small doubt on that swichvation we can define one more method is it possible
can you please give one simple example/scenario for that? I never used this way.