cancel
Showing results for 
Search instead for 
Did you mean: 

Is it direct database access from comp.cont is recommended.

Former Member
0 Kudos

Hi All,

I am using select statements in comp. controller methods to fetch data.

I know its not advisable to access database directly from View controller.. does it apply also to comp. controller..

ThanQ for ur time.

Cheers,

Senthil

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

You can use an assistance class and do all the database access in that. Do not do it directly in the component. It would also result in high prio checkman errors.

Regards

Nithya

Former Member
0 Kudos

hi,

yeas directly it is never advisible to use the Select statements eithe rin the view controller or Component Controller . it is always a good pratice to Create a separate class or function module or use the existing bapi's to get the data.

bbeacuse if you try to write the select statement inside the View or Component Controller then you will be violating the concept the Model View Controller(MVC)

cheers

thomas_szcs
Active Contributor
0 Kudos

Hi Senthil,

Yes, it's not advisable to this in the component controller. Database access should be encapsulated and separated from ui layer.

Best regards,

Thomas