on 09-07-2010 1:15 PM
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.
>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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
>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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.