Don't perform basic SQL tasks in code
Relational databases are a mature technology, and they should be used to do as much simple work as possible.
For example, don't do the following in code, if they can be done in SQL instead:
- ordering (ORDER BY)
- filtering based on criteria (WHERE)
- joining tables (WHERE, JOIN) -- see the code tables topic for a possible exception to this rule
- summarizing (GROUP BY, COUNT, AVG, STDDEV)
- be much less robust and efficient
- take longer to implement
- require more maintenance effort
Martin Fowler has published an interesting article
related to this topic.
See Also :
Implementing compareTo
Choosing the right Collection
Reduce database code duplication
Implement code tables
Choosing the right Collection
Reduce database code duplication
Implement code tables
Would you use this technique?
|
|