homepage Welcome to WebmasterWorld Guest from 54.205.144.54
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
Opinions on Views: To VIEW or not to VIEW?
When, where, how much, and why?
RWSteele




msg:3153009
 8:36 pm on Nov 10, 2006 (gmt 0)

This is more of a discussion than a cry for help and is open to anyone who wants to add their .02 (admins, gurus, developers, code monkeys, noobs, etc.).

This might sound like something from Databases 101, but I'm in my first work setting with people who have "DBA" and "Admin" in their title. I know it's just a job title, but some have very unorthodox and strange design theories and I wanted to make sure I wasn't way off with mine.

VIEWS. Personally, I love them. Let's say I have a Employee table with 15 columns and 7 have FK constraints established (ex. job status, department, manager, etc.). I'd create a view called "vw_Employees" or "vw_EmployeeDetails" with all of the joins neccessary to return meaningful information and not a bunch of cryptic IDs, unless of course that's what I need.

The security and performance advantages of views (indexed, partitioned, etc) are obvious, but the layer of abstraction created allows certain changes to be made (names, data types, etc.) without breaking an entire application or even pulling it offline. How can anyone think this is a bad thing?

Yes, there are situations where views are not very beneficial, but for the most part I find they save time somewhere.

1) Are views the best thing since sliced bread or the offspring of satan?

2) Do you use them? If so, when, where, why, and how?

 

FalseDawn




msg:3153116
 10:45 pm on Nov 10, 2006 (gmt 0)


1) Are views the best thing since sliced bread or the offspring of satan?

Used appropriately, somewhere between the 2 :)


2) Do you use them? If so, when, where, why, and how?

Not religiously, but they have their place. You have already mentioned some benefits, which I agree with - I would add that they can also help add some transparency to complex queries, too (or should that be remove transparency from?)

(black box, implementation hiding, much like stored procedures).

[edited by: FalseDawn at 10:48 pm (utc) on Nov. 10, 2006]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved