cancel
Showing results for 
Search instead for 
Did you mean: 

Best Practice for custom controller

Former Member
0 Kudos

Hi Experts,

In my current project we have one DC with single component and 12 views (4 business functionality each has 3 view flow ). Now complete logic is in component controller itself and planning to divide business logic into 4 custom controller based on business functionality.

Please guide me how i need to manger context variable and approach from below?

1. Maintain context in each custom controller and map to views. (Cust Cont ->Views) not maintained in comp Controller

2. Maintain all context in component controller and from there custom controller and from there views. (Comp Cont -> Cust cont -> Views)

3. Maintain context in custom controller and map to component controller and from there mapping to View. (Cust Cont -> Comp cont -> Views)

Regards,

Satya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think ,you should go for Option1 ,because there is no point in having Custom controller if you go for options 2&3 .

Regards,

Govindu

Answers (2)

Answers (2)

Sreejith1
Contributor
0 Kudos

HI,

If you are going to use Custom controller, always try to bind all related functionality and context in respective custom contollers.

Else there is no meaning in using that.When your application will expand in future this will help you.

Also i will not advice to separate if it is not important.Because if you are creating a new custom controller that much additional work will raise.

Thanks ,

Ram

marcel_frei
Participant
0 Kudos

I'm with Govindu,

Go for option 1.

If you have Context nodes you need in every view, you can map it through the component controller but if you have data only needed for 1 of the 4 business cases, then create the context nodes in the corresponding custom controller and map it to the views.