Can I improve performance by refactoring SQL commands into C# classes?
Posted
by Matthew Jones
on Stack Overflow
See other posts from Stack Overflow
or by Matthew Jones
Published on 2010-05-10T20:21:08Z
Indexed on
2010/05/10
20:34 UTC
Read the original article
Hit count: 220
Currently, my entire website does updating from SQL parameterized queries. It works, we've had no problems with it, but it can occasionally be very slow.
I was wondering if it makes sense to refactor some of these SQL commands into classes so that we would not have to hit the database so often. I understand hitting the database is generally the slowest part of any web application For example, say we have a class structure like this:
Project (comprised of) Tasks (comprised of) Assignments
Where Project, Task, and Assignment are classes.
At certain points in the site you are only working on one project at a time, and so creating a Project class and passing it among pages (using Session, Profile, something else) might make sense. I imagine this class would have a Save() method to save value changes.
Does it make sense to invest the time into doing this? Under what conditions might it be worth it?
© Stack Overflow or respective owner