SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 35 of 35
  1. #26
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,246
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    and if you should decide one day that you want others besides just you to be able to post? ever visited boing-boing or other similar blogs where there's more than one individual posting? you're saying "no, i don't ever, ever, ever want the option of doing that"?

    design for maximum flexibility, my friend
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  2. #27
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    True, true. But that dosen't necessarily mean that I'd want the exact same fields in comments and in posts. I could imagine adding quite a few features to posts that wouldn't be in comments, and then I'd be wasting most of those columns (assuming more comments than posts). Or what if I add features like comment moderation that don't apply to posts? I could see those two types diverging...
    Web Design:
    http://www.numbera.com/
    Free Web Design Resources and Software:
    http://brh.numbera.com/

  3. #28
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,246
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by dalangalma
    I could imagine adding quite a few features to posts that wouldn't be in comments, and then I'd be wasting most of those columns (assuming more comments than posts). Or what if I add features like comment moderation that don't apply to posts? I could see those two types diverging...
    i understand your concern

    since you are still in the database design phase, you need to do a quick bit of research on subtypes and supertypes

    posts and comments are really two types of the same thing (and the pingtracks would be a third)

    some people put all the columns that they have in common into a common table, with separate tables for each type

    other people put everything into one table, including all columns required by all types, so that for each row, the columns not required by that type are NULL

    "then I'd be wasting most of those columns" is not true, because NULL doesn't take any space

    the deciding factor in whether subtypes/supertypes have separate tables or not is the range and complexity of sql necessary to maintain them separately versus in a common table

    i tried to give an example of this earlier when i mentioned categorization

    if you have a many-to-many relationship from posts to categories, and if your posts are separate from comments, then you're okay, but if you also want a many-to-many relationship between comments and categories, you're screwed, because now any search based on category is twice as complex as it needs to be

    i know, i know, you're gonna come back with "but i will never want to categorize the comments, ever"

    another example is fulltext search -- if you're looking for certain words and phrases, and youhave separate posts and comments, bingo, your search sql is twice as complex

    all i'm saying is you had better know exactly what you want from your database before you create those tables

    in my experience, it is a lot easier to do most applications with a common table for subtypes and supertypes, even if you then place other stuff into separate tables as needed

    the common table in your example would include category relationships, fulltext fields, date added/changed, ip number, etc. etc.

    in fact there are way more common columns between posts and comments than different

    but it sounds like you are starting out with no common table on purpose and i am just trying to caution you against that
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #29
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm. That sounds reasonable...
    Web Design:
    http://www.numbera.com/
    Free Web Design Resources and Software:
    http://brh.numbera.com/

  5. #30
    Google Engineer polvero's Avatar
    Join Date
    Oct 2003
    Location
    Mountain View
    Posts
    567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <reminisce>
    I remember a few years back when I first got my copy of kev's book on byoddws and within a week I had built my own blogger . it took in a simple headline, teaser text, body text, and a date. and just for fun I threw in a str_replace function for all my smilies I thought i was hot stuff back then.

    Boy has the times evolved.
    </reminisce>

    Good luck on building your blog

  6. #31
    there is no box baztorres's Avatar
    Join Date
    May 2004
    Location
    UK - London \ Surrey
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good thread. Cheers for the debates chaps.
    Baz
    ---

  7. #32
    Non-Member Musicbox's Avatar
    Join Date
    Nov 2004
    Location
    india
    Posts
    1,331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why dont you just hire a coder from http://www.rentacoder.com and it will be completed in a minute or day.

  8. #33
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.sitepoint.com/forums/show...9&postcount=22

    Quote Originally Posted by Dalan Galma
    Because making my own is more fun...
    Web Design:
    http://www.numbera.com/
    Free Web Design Resources and Software:
    http://brh.numbera.com/

  9. #34
    SitePoint Guru asterix's Avatar
    Join Date
    Jun 2003
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    you insult an entire profession (which includes me) and then withdraw?

    i shall wait a few days for you to show me a page with even 5 levels visible, sir

    until then, sir, clearly you have lost this round

    See this hierarchy.
    How many levels do you count? More than 5 ?


  10. #35
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,246
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    hey, nice example!!

    sure took you long enough

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •