cancel
Showing results for 
Search instead for 
Did you mean: 

customcontroller?

Former Member
0 Kudos

Hi

can u explain me role of custom controller in webdynpro java

Thanks

Kishore

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Kishore,

In web dynpro development there are two kinds of controllers

Component Controller: one which is created by default whenever a Webdynpro comoponent is created

Custom controller: one which is created explicitly at design time by the developer.

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

we can have only one Component controller for any web dynpro component but we can have more than one custom controller for any Web Dynpro Component.

You can refer help.sap.com if you require further information

Thx

kris

Answers (6)

Answers (6)

Former Member
0 Kudos

closed

snehal_kendre
Active Contributor
0 Kudos

Hi Kishore,

We need custom controller when we want separate UI logic from backend logic.

Thats why custom controllers are usefull when you create data cust and UI cust.

use of one custom controller is as equal as using default controller.

1. A UI element should not access backend data directly.

2. so one custom controller will be dedicated for backend logic.

which fetches data from backend and store it in context. generally called as DATA cust

3. Second controller is used for UI logic. where on node containes copied data from DATA cust. it is called as UI cust

4. finally webdynpro UI is mapped with UI cust. so that any change in UI will not affect the data in backend immediately.

but if you used only one controller, whether it is custom or default. any change in UI will directlly affect the data.

So as per the MVC architecture and SAP recommendation it is advisable to use cutome controller. as(DATA CUST & UI cust)

Former Member
0 Kudos

Hi,

Custom controller is same as component controller.

CustomController doesn't have any visual interface.

Generally customcontroller is used to reduce the burden of component controoller.

Suppose we need to handle multiple BAPi's in the component controller ,It creates burden to the componet controller and the code looses readability.

So in such cases we can create any number of custom controllers,But there will be only one componet controller for a componet

Regards

Padma N

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

Custom controllers logically same with component controller with out no visual interface and the functionality must be stick with in the component.

Mainly this custom controller is used to reduce the burden on the component controller.For example if you have two RFC execution one you are using with in the component only,other you need to expose outside.Then execute first RFC in Custom controller INIT method and second go with component controller.

This is just an example suppose if you have lot of things to be done in comp controller that becomes burden and takes time to initialize the component.Split the functionality which based on internal comp usage and external comp usage,like that.

Regards

Kalyan

Former Member
0 Kudos

HI

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

Surya

Former Member
0 Kudos

Hi,

Their is not much difference between custom controller and component controller , other than we can have multiple customcontrollers where as only one component controller.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi ,

Normally Component controller will be available by default when we create a new Webdynpro application. Custom Controllers can be created depending on the requirement of the custom application. When going for a custom RFC, it is the best practice to map and execute it thru a custom controller rather than messing up everything in the default Component Controller .

Regards,

Tony Isaac.