|
Re: Gavin King: In Defence of the RDBMS
|
Posted: May 29, 2007 9:15 AM
|
|
I had suggested using views as an abstraction layer, not as a mapping layer. It is not a mapping from table(s) to a class, though, in effect, it comes down to the same. The point is that the view represents the business need, not necessarily the class's view of the data.
The key is that different applications can use different views based on the same underlying data structures. If the application requirements change, or the classes change, then we can always change the views without affecting the internal database structure. For example, let us say that our Person class now needs the home address of the person. Just change the person_view to fetch the home address. The class has changed, the view has changed, yet it has not affected the underlying data structures. In this sense, views can be used to serve as an abstraction layer, hiding the data structures form the application.
At the same time, we can change the internal representation of the database for whatever reason, and change the views to conform to the new internal representation without any application needing to know of this change.
Seen this way, the view is more of an interface between the application layers and the database; just like stored procedures and functions should be. Interfaces, as we all know, should not change very frequently. The implementation of the interface can change as often as needed, without affecting the applications that use it.
|
|