October 2006
Intermediate to advanced
880 pages
22h 11m
English
Imagine that you don't want to see all the data in your database. For example, the currently logged-in application user may not have the rights to see everything. Usually, you add a condition to your queries and restrict the result dynamically. This becomes difficult if you have to handle a concern such as security or temporal data ("Show me only data from last week," for example). Even more difficult is a restriction on collections; if you iterate through the Item objects in a Category, you'll see all of them.
One possible solution for this problem uses database views. SQL doesn't standardize dynamic views—views that can be restricted and moved at runtime with some parameter (the currently logged-in user, ...