cancel
Showing results for 
Search instead for 
Did you mean: 

Reg:Custom controller

Former Member
0 Kudos

Hi,

can any one explain me the use of custom controller over component controller.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi jyothi,

The properties and use of the custom controller that can be added optionally correspond exactly to those of the component controller. This means that it is visible to all elements of the component and the lifetime of the elements is the lifetime of the component. The custom controller gives you the option of structuring functions and data within a component. It makes sense to create and maintain a custom controller if a certain subset of views of a component should be equipped with a special function or with a special set of data.

Regards,

Sunaina Reddy T

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi

Custom controllers are helpful when your business logic is too big for the single component controller and need to be separated on some more or less independent pieces. Custom controllers will be created only when the application really needs them on run-time. This will also reduce memory consumption, because you will not load all the data, but only the necessary pieces of it.

If your logic (number of model nodes, service invocations) is quite simple you do not need any custom controller.

BR, Sergei

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Jyothi

Custom Controller is as same as component controller,but you create them whenever you needed it.

Custom controller is created whenever you need to write separate busineess logic

You can create multiple custom controllers.

For example, controller functionality that is common to different views, but not relevant for the component as a whole, could be placed in a custom controller.

Edited by: Tulasi Palnati on Jul 10, 2009 7:48 AM

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Jyothi,

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

For more information check this

http://help.sap.com/saphelp_nw70/helpdata/EN/b9/b82c4142aef623e10000000a155106/content.htm

Regards,

Praveen Kumar M

Former Member
0 Kudos

Hi,

Component controller will be instantiated as soon as your webdynpro component is invoked.

Custom controller will be instantiated when we try to access any method/context from this controller. Till then it will not instantiated.

Suppose, if you have a model, Get All Sales order which can have a 1000 records. And there is a chance of very less users will access this. If you mapped this model to component controller this complete context will be instantiated as soon as the component is instantiated.

But If you put the same in custom controller only when the user tries to access this model then only all the context will be instantiated.

Regards,

Jaya.