cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between custom controller and interface component

Former Member
0 Kudos

Hi,

Can anybody tell me what are the differences between component controller and custome controller , component interface.

Thanks in advance.

Regards

sireesha.

Accepted Solutions (0)

Answers (2)

Answers (2)

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi sireesha

I will tell you the exact difference between the custom and component controller.

Logically speaking there is no difference between those two controller,As per the applications point of view assume that i have 5 Component controllers,all requires a functionality which is similar,Instead of writing the code in all 5 controllers,I will write the code in one controller called like Customcontroller and i will use the functionality in my 5 comp-controllers by declaring the custom controller.Hence the redundancy is eliminated here.

Thanks and regards

venkata kalyan

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

When any component is created web dynpro framework automatically generates the controller(controller is nothing but entity which controls the working of views and acts as a binding layer between model and view), this controller is called Component controller.

We can have as many controller as we want, but they should be used sparingly, Controller should encapsulate the functionality which is common to whole component , like if your application fetches master data and appliaction data so better you should have 2 controller , 1 for master and 2 for application so as to have modularisation in your application.

Component Interface is the entity which is used when you want to use the functionality defined in some other component i.e. if your main component is acting as a parent comopnent then the child component usage should be defined via this interface controller under Component Interface, so that main compo will access it via childs Interface Controller.

Other node under this , Interface view , gets generated for every creation of window , Interface view is entry point into our application for web Dynpro framework

jsut check out following links,

check out these ex for the Component Interface and node under this,

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/webcontent/uuid/19e6e990-0201-0010-eca6-a62e342eaa... [original link is broken]

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/webcontent/uuid/1208c2cd-0401-0010-4ab6-f4736074ac... [original link is broken]

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/webcontent/uuid/1ee0e990-0201-0010-75bf-a087c241cb... [original link is broken]

hope it helps

regards

Former Member
0 Kudos

Abhijeet,

Thank u for ur reply.

Whats the difference between custom controller and component controller.

Regards

sireesha.

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

Cntroller : It is used to drive the functionality i.e., view controller are used to drive the functionality of view(visual interface).

When we create any component Component Controller automatically gets generated ,so as to drive the functionality of whole component. This is default activity and we cant control that.

there is no difference between custom and component contr, the only difference is their name Component(gets created by default), custom (user created).

Whichever controller you use , the purpose goin to be same. Sidelining the default controller, you can define your own controller to put the code in it so as to drive the functionality you wish.

hope it clears your doubt.

regards

former_member286976
Active Participant
0 Kudos

Hi Sireesha,

There is no difference between Component and Custom controller from a coding point of view. However in certain cases the number of Component controllers that can be created in a Development Component is limited to one. In those cases if you would like to modularise your code, you can use a Custom controller. Also custom contoller has got some additional importance when you use ur DCs as plug-ins and want to provide some configuration property to your components. Those cases the configuration models are directly mapped to cutom contoller and set this as configuration for the main component which will be a component controller.

See the link <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/944ea9e5-0601-0010-65b3-b49a56eb6385">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/944ea9e5-0601-0010-65b3-b49a56eb6385</a>

for more details.

Regards,

Sudeep

former_member189631
Active Contributor
0 Kudos

Hi Sireesha,

Contoroller:

*Controller is cental function of Webdynpro to share the data accross

several Views.

*To pass the data between views the component controller is used.

*Every webdynpro Java project contains one component controller.

*Custom controller is doing the same functionality over Component controller. that

can be used when the projects has complexity.

for exaple you are usins 3 BAPIs in your project to access/store data from/to

R/3. If you all of them in a single component controller the complexity will be high.

*So the developer need something to reduce the complexity of the Project.That is called Custom Controller.

*the developer can have no of CUSTOM controller to satisfy his Requirement with minimum complexity.

Regards,

Ramganesan K.

Former Member
0 Kudos

sireesha,

Technically speaking, they are very similar. The only 3 differences are:

-- Component controller is mandatory, it must exists for every component so it's pre-created by WD design tools automatically. On other hand, custom controllers are optional, developer can create as many custom controllers as necessary for particular tasks carried out by component.

-- Component controller has special "hook" methods invoked by WD runtime at specific phases of request processing (actually, pre-/post processing and application hibernation/activation in latest versions of NW04s). Custom controllers have no such hooks.

-- Component controller is the first controller that is initialized. It's created by WD runtime in "eager" manner at the time of component initialization. Custom controllers are lazy initialized by run-time on first actual use (like method call or context access).

Valery Silaev

SaM Solutions

http://www.sam-solutions.net