on 07-22-2008 11:17 AM
Hi Gurus,
What is the difference between Custom and context controller?
In which occasion we should prefer to use Custom Controller?
Thanks in Advance,
Dharani
Hi Dharani,
A Context controller it's a view-orientated controller. It is responsible for the interaction between a view and a node of the MVC model. They normally are created when you access a view, and destroyed when you leave it.
A Custom controller it's like a global controller of the MVC model. They aren't associated with a view, and they are always present in memory to store MVC model data/information.
Kind regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dharani,
Component Controller:-
The component controller is the master controller for a Web Dynpro component. As soon as you declare the existence of a Web Dynpro component, the component controller is automatically created. You cannot have a Web Dynpro component without a corresponding component controller.
This controller can be thought of as being hierarchically superior to all other controllers in the component. Consequently, the lifespan of the component is always equal to the lifespan of the component controller.
Custom Controllers:-
Custom controllers are similar to the component controller in that they too have no visual interface. However, the existence of custom controllers is controlled entirely by the Web Dynpro developer at design time. Declaring the existence of a Web Dynpro component causes the component controller to be created automatically, but this is not the case with custom controllers. Custom controllers are only created by an explicit design time declaration.
When should a custom controller be used?
Custom controllers should be created only when their presence will simplify the overall structure of the component. The principles to follow for deciding when a custom controller is needed are controlled by:
u2022 Reuse
Create a custom controller if you have identified a reuse case for a specific unit of code required by several other controllers within the component.
u2022 Task separation
To avoid placing too much coding in the component controller (and thereby potentially increasing its initialisation time), place coding dedicated to a specific task into a separate custom controller
While you can say Component controller is the default custom controller. And more over you can create as many custom controllers as you want for better maintenance.
regards,
Swati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.