cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro for Java: Controllers

Former Member
0 Kudos

Hi,

Please let me know the differences between Component Controller and Custom Controller.

Thanks,

Ramesh.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

WebDynpro controllers are of 2 types:

1.Controllers with visual interface.

2.Controllers without visual interface.

Component controller & Custom controller fall under the 2nd type(no visual interface)

Component controller:

The component controller is the master controller for a Web Dynpro Component.When you declare the WebDynpro component, the component controller is automatically created.You cannot have a Web Dynpro Component without a component controller.It is superior to all other controllers in the component.Life Span of component is always equal to the life span of component controller.component controller acts as the central point of control for the behaviour of the webdynpro component.

Custom controller:

Custom controllers are only created by an explicit design time declaration by the developer.custom controllers are to be created when their presence will simplify the overall structure of the component.

Need of Custom Controller:

1.Create when you want a specific unit of code to be resused by several other controllers within the component.

2.To avoid placing too much coding in the component controller(when you need to encapsulate separate logic).

Regards,

Bala Baskaran.s

ankur_garg5
Active Contributor
0 Kudos

Hi Ramesh,

See the following links for understanding the difference between the two:

[Web Dynpro Java Controller and Interface Concept|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0ba2c45-0518-2a10-73be-9b785e10aef1] (Page 6)

[Controllers|http://help.sap.com/saphelp_nw04s/helpdata/en/43/ec197a15444c60e10000000a155369/content.htm]

[Component Controller|http://help.sap.com/saphelp_nw04s/helpdata/en/44/0dca602d9d1ca2e10000000a11466f/content.htm]

[Custom Controllers|http://help.sap.com/saphelp_nw04s/helpdata/en/44/0dca942d9d1ca2e10000000a11466f/content.htm]

Lastly,

The component controller is a special custom controller that is automatically created when a component is created. It is this controller that drives the functionality of the entire component.

Bye

Ankur

Do reward points for helpful as well as solved answers!!

Former Member
0 Kudos

Hi Ramesh,

component controllers:Default controller inside every webdynpro component:own context events,public methods.This is also called as global contoller the lifetime of this controller is determined by the the lifetime of the entire application.

custom controllers:Additional controller for encapsulating seperate logic.

custom controllers are essentially the same as component controllers,but u can create them when needed.

1)create custom controllers when u need to encapsulate seperate logic.

2)you can have multiple custom controllers

Both of them exist as long as the comonent they belong to exist.

Regards,

Tilak

Former Member
0 Kudos

Hi,

Check these discussions for good understanding.

Please post the question in Expert Forums » Application Server » Web Dynpro Java i.e., for better results.

Regards,

Harini S