cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro MVC Architecture

nagendran_r2
Explorer
0 Kudos

Hi,

I have this q in mind for a long time and even after surfing a lot, am unable to get the proper answer.

According to MVC model we need to have the business logic seperately in a model.

can anyone pls explain me why the performance will be affected if I put a select query in view hook methods or some where directly without a model ( FM or class methos) .

Thanks

Nags.

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

>can anyone pls explain me why the performance will be affected

the performance that will be impacted is your support team's performance. And potentially your future development team's if they ever try to get some reuse out of your development.

MVC is about building/designing in a easier to understand/reuse manner. Never assume to support your development yourself.

Answers (2)

Answers (2)

nagendran_r2
Explorer
0 Kudos

Thanks Thomas Jung & Chris Paine .

One more thing, as a best practice I was asked to create all the nodes globally in component controller and then I shd use that in my local view controller.

Is it a best practice.

Thanks.

Former Member
0 Kudos

the advantage with this approach is you can bind the nodes of component controller to different views and exchange data between them

Thanks

Bala Duvvuri

ChrisPaine
Active Contributor
0 Kudos

The other advantage is that you can remove non-view specific functionality from the view. By having your context in the controller you can abstract control logic from display logic, but still use the same data. Then in the future you can easily implement another view for your component to display/manipulate the same information in a different way - whilst still using the common controller functionality -> the separation of the C and the V in MVC.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>can anyone pls explain me why the performance will be affected

Who said that MVC has anything to do with runtime performance? If you think that is the point of MVC, then you are mistaken. It doesn't have anything to do with runtime performance. MVC and the rules in WDA about not putting SQL direclty into the controller methods is about enforcing better organiation of your code. This improves long term maintainability of the application.