How do views reduce code duplication?

Posted by Debuger on Stack Overflow See other posts from Stack Overflow or by Debuger
Published on 2010-04-13T14:58:54Z Indexed on 2010/04/13 15:02 UTC
Read the original article Hit count: 312

Filed under:
|
|
|

Hi! I read something like this about db views:

Views are incredibly powerful and useful for one reason that stands out above all the other very good reasons. They reduce code duplication. That is, in most cases, the bottom line. If a query will be used in three or more places, then a view will drastically simplify your changes if the schema or query parameters change. I once had to edit 22 stored procedures to change some query logic. If the original architecture had utilized views, then I would have had only three changes.

Can anyone explain to me how it works, and maybe give me some examples?

Best regards!

© Stack Overflow or respective owner

Related posts about views

Related posts about query