https://bugs.documentfoundation.org/show_bug.cgi?id=104651

--- Comment #2 from Howard Johnson <[email protected]> ---
(In reply to Regina Henschel from comment #1)
> Perhaps
> http://stackoverflow.com/questions/1278521/why-do-you-create-a-view-in-a-
> database gives you some ideas, why views are necessary.
> 
> I recommend closing this issue as "Wontfix".

I know there will be resistance to this, because once something is in place
people want to defend it, even when there is a good reason for the change.


But each, and every one of these suggested uses, can be done by a query:


1. Views can hide complexity

If you have a query that requires joining several tables, or has complex logic
or calculations, you can code all that logic into a view, then select from the
view just like you would a table.

*** Queries can hide complexity just the same.  I have used sub-queries for 20
years to do just this.



2. Views can be used as a security mechanism

A view can select certain columns and/or rows from a table, and permissions set
on the view instead of the underlying tables. This allows surfacing only the
data that a user needs to see.

*** In LibreOffice is this used?  No.  And there are good reasons for it, first
and foremost is that it's not a very good security practice in the first place.
 Security should be comprehensive, and well thought out, where the entire
server is protected.  It would be easy to go around a view I think.



3. Views can simplify supporting legacy code

If you need to refactor a table that would break a lot of code, you can replace
the table with a view of the same name. The view provides the exact same schema
as the original table, while the actual schema has changed. This keeps the
legacy code that references the table from breaking, allowing you to change the
legacy code at your leisure.

*** As long as queries can reference other queries, queries can do this just as
well.  And because only one layer is involved it keeps the user interface
simpler, with less places to look when remodeling code.


But here is the single most important reason to use queries in favor of views:
There is no good reason to use a view, when a query can do everything a view
can do.  And having just one flexible layer in-between tables and forms/reports
simplifies things, without any loss of functionality.

I have many times, over decades of use, and hundreds of data sets, used queries
in MS Access to do each of the 3 things listed in this referred to post.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to