cancel
Showing results for 
Search instead for 
Did you mean: 

custom and component controller

Former Member
0 Kudos

i need in good explanation on this topic

Difference between custom and controller

and plz explian with a real time example wen we use component controller and

wen we need to go for custom controller

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Samyukta,

This is the explaination

Web Dynpro controllers come in two distinct types – those that have a visual interface, and those that do not. Those controllers that have no visual interface are known as custom controllers, and those with a visual interface are known as view controllers.

Custom Controllers

Custom controllers should be used sparingly. They are designed to encapsulate a unit of functionality that requires no direct interaction with the user. In practice, you will find that the number of situations in which a custom controller is required is low.

There is however, one notable exception to this rule. Whenever you create a Web Dynpro component, you are implicitly creating a special custom controller called the component controller. A Web Dynpro component has one, and one only component controller. As with all custom controllers, the component controller has no visual interface, and relies on the existence of one or more view controllers to provide it with a visual interface.

Important: At runtime, a component instance may have one and one only instance of each of its defined custom controllers. In other words, all custom controller instances are singletons with respect to their parent component instance.

Remember that just because you can create a custom controller, does not make it is a good idea to do so. Before creating a custom controller, ask yourself whether its presence will simplify or complicate the architecture of your component. If possible, always aim for simplicity of design!

Important: If a component contains multiple custom controllers, then the order in which the WDF instantiates them is indeterminate. Do not make any assumptions about the instantiation order!

Component Controllers

A component controller is a special form of a custom controller and should be considered the central point of control for a component. Within the scope of a component, the component controller is a singleton class, hierarchically superior to all its view and custom controllers

regards

Sumit

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi sam,

Component Controller: Every component contains a single component controller by default. It has no visual interface and can be seen as a component’s master controller.

Custom Controller: A custom controller is an optional controller (0..n) inside a component having no visual interface. It is there for implementing specific application logic concerns (value help listeners, configuration) inside a separate controller and outside the component controller.

Regards,

karthik.

Former Member
0 Kudos

Hi,

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 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.

When the Web Dynpro Runtime receives the URL of a Web Dynpro Application, the component controller of the root component is instantiated. Here is an example of where the Web Dynpro Runtime automatically interacts with coding written by the Web Dynpro developer.

Since the component controller has no visual interface, it is incapable of directly presenting any information to the user. This task however, is of no concern to the component controller. The component controller should contain only the coding necessary to control the interaction of all the other controllers and child component instances within the component. You should regard the component controller as the central point of control for the behavior of the Web Dynpro Component.

Custom controller

-


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.

Regards,

P.Manivannan

Former Member
0 Kudos

Hi Sam,

You can go through this link. It is regarding similar kind of thread

Regards

Mrityunjay

Former Member
0 Kudos

Hi,

Have a look at this thread

Kind Regards

Saravanan K