cancel
Showing results for 
Search instead for 
Did you mean: 

Impact of writing select statement in View controller in WD4A

Former Member
0 Kudos

Hi Experts,

I am in a support project of WD. A WD component is there where select query has been written in the view controller  methods.

I know the correct approach is to write select query within the methods of Component controller and call  from the onaction event handler through wd_comp_controller-> method( ) .

But the said has not been done. Now application is running fine .So I want to ask what kind of impact will be there ??

More over if you know in advance  that a  particular attributes or  select statement having less records is going to use only once and no where in other place than can we write in view controller .

Any approach is there where i can do analysis of the said impact.

Thanks in advance

DK

Accepted Solutions (0)

Answers (2)

Answers (2)

ChrisSolomon
Active Contributor
0 Kudos

Can you? Sure. Should you? Really up to you. HOWEVER....although it may work, always keep this in mind.....SEPARATION OF CONCERNS.

Former Member
0 Kudos

Hi ,

When you declare any method in view(S) the life span of that method will be limited to that view..But when you declare the method in component controller ,you can access that method in any controller of your webdynpro component in which it is declared.

But it is not suggested to write application/business logic(S) in your webdynpro component...Better you seperate your application/business logic with presentation logic using assistance class as

Every Web Dynpro application is structured according to the Model View Controller programming model where

1)  The model forms the interface to the back end system and thus enables the Web Dynpro application access to data.

2) The view is responsible for the representation of the data in the browser.

3)The controller lies between the view and the model. The controller formats the model data to be displayed in the view, processes the user entries made by the user, and returns them to the model.

Hope this helps you to understand better.Revert back if you need more info..

Thanks

KH

Former Member
0 Kudos

Hi Katrice,

I know its recommended to write business logic in Assistance class to follow MVC paradigm as well as  methods/attributes declared in component controller will be available across views.

But as I said I m in support project and I have seen a component having methods with select statement in view controller so I m asking what is the impact in terms of performance and WD framework behavior if select statement have been written in view controller . Shall I do the modification and if yes than what benefits i will get in this existing application ?.

Regards,

DK

Former Member
0 Kudos

I m asking what is the impact in terms of performance and WD framework behavior

Hi ,

There will no performance effect where you write your application login in view controller or component controller/framework.

The performance depends on type of your application logic and no. of records exists in Data base.

Thanks

KH

former_member197475
Active Contributor
0 Kudos

Hi Dharmkrit,

It will based exactly on what Katrice admits.

I have tested by coding simple queries(like Slect single) in views, and I don't feel the difference in performance ratther than writing the same code in Component Controller.

But if you write a query handling a large no. of records(nearly 30000), you can realize that the WDA takes a long time to process the entire records.

BR,

RAM.

Former Member
0 Kudos

Hi,

Is your query addressed?.. If you still require any further more explanation,revert back.

Thanks

KH