Results 1 to 10 of 10

Thread: Curious as to the "correct" way

  1. #1
    Mostly Me Lucio's Avatar
    Join Date
    Mar 2007
    Location
    Tring
    Posts
    5,163
    Thanks
    443
    Thanked
    448 times in 351 posts
    • Lucio's system
      • Motherboard:
      • Gigabyte GA-970A-UD3P
      • CPU:
      • AMD FX-6350 with Cooler Master Seldon 240
      • Memory:
      • 2x4GB Corsair DDR3 Vengeance
      • Storage:
      • 128GB Toshiba, 2.5" SSD, 1TB WD Blue WD10EZEX, 500GB Seagate Baracuda 7200.11
      • Graphics card(s):
      • Sapphire R9 270X 4GB
      • PSU:
      • 600W Silverstone Strider SST-ST60F
      • Case:
      • Cooler Master HAF XB
      • Operating System:
      • Windows 8.1 64Bit
      • Monitor(s):
      • Samsung 2032BW, 1680 x 1050
      • Internet:
      • 16Mb Plusnet

    Curious as to the "correct" way

    Ok, on our company website we've recently asked the developers to add a more effective search engine to cover our range of keys. The site is written in PHP and uses MySQL to store the data

    Each key has several different attributes that a customer might want to use to search on, split into two different searchs, such as what type it is, what it's made from, overall size and so on. The solution we've been given for this looks to be ok, as it stores a table with catagories and then in another table there's a list of what each catagory can contain.

    So far so good I thought?


    The second part of the search is the one I think is generating the problem. For car keys, we need to store the Make, Model and Year range that each particular key works and each key can have more than one vehicle or year range it works on (personally I wanted a start date and an end date but aparently that's too hard for them)

    Now, the way they've stored this information is three tables, one storing Make, one storing model (which references the Make) and one storing the Year (which references the Make table) and then the search looks up entries in the Year table. Now to me, this seems completely arse about face, but I can't seem to get the website developers to understand this. More importantly, the search page simply fails to work if you don't have at least one complete entry in the Vehicle listing (e.g. a Make with a Model Underneath it and a Year underneath the model).


    What I'm looking for is some basic advice on how you'd solve this problem, because I really don't have any faith in the design company to solve this and I'd like to offer a more proactive solution than simply going "It's broke, I've checked and double checked the data going in and that's ok"

    (\___/) (\___/) (\___/) (\___/) (\___/) (\___/) (\___/)
    (='.'=) (='.'=) (='.'=) (='.'=) (='.'=) (='.'=) (='.'=)
    (")_(") (")_(") (")_(") (")_(") (")_(") (")_(") (")_(")


    This is bunny and friends. He is fed up waiting for everyone to help him out, and decided to help himself instead!

  2. #2
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable

    Re: Curious as to the "correct" way

    This is how I'd do it.

    table: Cars
    int carid (primary key)
    string model
    int make (reference to Manufacturers.makeid)
    int year (reference to Year.makeid)

    table: Manufacturers
    int makeid (key)
    string make

    table: Year
    int yearid (key)
    int year

    Then, when you're looking for a list of cars in a given year, with SQL queries, such as "SELECT yearid FROM Year WHERE year==$year", then use that to query the Cars table with "SELECT * FROM Cars where yearid=$yearid", and so on, so forth. You could expand that last query to return a more relevant resultset, so to PHP the data will be:
    int carid
    string model
    string make
    int year

    etc..
    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  3. #3
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Curious as to the "correct" way

    this is the joy of using ideas from 20 years ago.

    you've got a database, that sounds as though its a million miles away from 3rd normal form.

    for the search they want to build some kind of index layer over the top, which also dictates the options, but then u've got all kinds of concurrency issues?

    now if only there where technologies like http://weblogs.asp.net/scottgu/archi...nslations.aspx or http://www.nhibernate.org/
    where you get used to simply forgetting about such trival stuff as how your data is stored.

    you can simply go

    CarBookings.Unique(x=>x.Model) to get your available models etc.

    Moving the database to 3rd normal form would break everything. Why not do it properly and move it to a technology of this century?
    throw new ArgumentException (String, String, Exception)

  4. #4
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable

    Re: Curious as to the "correct" way

    Quote Originally Posted by TheAnimus View Post
    this is the joy of using ideas from 20 years ago.

    you've got a database, that sounds as though its a million miles away from 3rd normal form.

    for the search they want to build some kind of index layer over the top, which also dictates the options, but then u've got all kinds of concurrency issues?

    now if only there where technologies like http://weblogs.asp.net/scottgu/archi...nslations.aspx or http://www.nhibernate.org/
    where you get used to simply forgetting about such trival stuff as how your data is stored.

    you can simply go

    CarBookings.Unique(x=>x.Model) to get your available models etc.

    Moving the database to 3rd normal form would break everything. Why not do it properly and move it to a technology of this century?
    What?

    Just because something is old and lost it's hyperbole factor (many) years ago, it doesn't mean it went bad or that newer variants are superior. Usually it's the opposite. And frankly, not caring about how your data is structured is lazy to the point of negligence.

    Also your post was completely unhelpful to the OP.
    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  5. #5
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Curious as to the "correct" way

    If you fail to leverage new technology that makes it quicker and easier to develop stuff, thats a cost.

    My point is, it sounded like they are fighting against a lack of a schema?

    Why not look at an evolved way of doing it?

    Play with somehting like Linq to Sql, and tell me it isn't better to be data store agnostic, espesually when speccing out something like this!
    throw new ArgumentException (String, String, Exception)

  6. #6
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: Curious as to the "correct" way

    Not too sure how you reckon LINQ to SQL is data store agnostic, when it runs against SQL Server only, and how you can recommend it, when it is going to be dead and redundant in a few months.
    To err is human. To really foul things up ... you need a computer.

  7. #7
    Mostly Me Lucio's Avatar
    Join Date
    Mar 2007
    Location
    Tring
    Posts
    5,163
    Thanks
    443
    Thanked
    448 times in 351 posts
    • Lucio's system
      • Motherboard:
      • Gigabyte GA-970A-UD3P
      • CPU:
      • AMD FX-6350 with Cooler Master Seldon 240
      • Memory:
      • 2x4GB Corsair DDR3 Vengeance
      • Storage:
      • 128GB Toshiba, 2.5" SSD, 1TB WD Blue WD10EZEX, 500GB Seagate Baracuda 7200.11
      • Graphics card(s):
      • Sapphire R9 270X 4GB
      • PSU:
      • 600W Silverstone Strider SST-ST60F
      • Case:
      • Cooler Master HAF XB
      • Operating System:
      • Windows 8.1 64Bit
      • Monitor(s):
      • Samsung 2032BW, 1680 x 1050
      • Internet:
      • 16Mb Plusnet

    Re: Curious as to the "correct" way

    Quote Originally Posted by TheAnimus View Post
    If you fail to leverage new technology that makes it quicker and easier to develop stuff, thats a cost.

    My point is, it sounded like they are fighting against a lack of a schema?

    Why not look at an evolved way of doing it?

    Play with somehting like Linq to Sql, and tell me it isn't better to be data store agnostic, espesually when speccing out something like this!
    To be fair to TheAnimus, I asked for the "correct" way to handle a task like this, not how on earth I'm going to get the web developers to make it work given the current limitations (LAMP setup)


    At the end of the day, it confirms my suspicions that the Sales Manager hasn't given enough thought to the project, and instead has focused on the surface things like "is it pretty". It's bad enough that I'm having to convert a tonne of data from our SOP system that runs on FoxPro and comes out via Excel into web ready information, but to then discover after doing all the work that in fact the system can't handle it and was tested with "a couple of examples and worked fine"


    WTB: Real IT job please!

    (\___/) (\___/) (\___/) (\___/) (\___/) (\___/) (\___/)
    (='.'=) (='.'=) (='.'=) (='.'=) (='.'=) (='.'=) (='.'=)
    (")_(") (")_(") (")_(") (")_(") (")_(") (")_(") (")_(")


    This is bunny and friends. He is fed up waiting for everyone to help him out, and decided to help himself instead!

  8. #8
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Curious as to the "correct" way

    Quote Originally Posted by yamangman View Post
    Not too sure how you reckon LINQ to SQL is data store agnostic, when it runs against SQL Server only, and how you can recommend it, when it is going to be dead and redundant in a few months.
    If you've written with Linq To SQL, what difficulty to you have porting to any other LINQ provider? pratically nothing!

    I still like LINQ to SQL as an incredibly easy to learn system. It's stupidly simply to get to grips with.

    The idea is thats its only the Objects that matter, and you don't give a toss about how its stored. For so many things you dont have to worry (ok, part of my day job includes interacting with a bespoke tick database, i wouldn't begin to sugest you could ignore something like that!) without any thought.

    So, my point is if you've designed against linq to sql with your code, how hard is it to move to nHibernate or whatever the flavour of the month is?

    Ps linq to sql isn't going to be dead, just not have new features added, its still a great example!

    And Apologies to Lucio, i took this more as a "how would i ensure i'm never in this situation, ever" type question.
    throw new ArgumentException (String, String, Exception)

  9. #9
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS

    Re: Curious as to the "correct" way

    Quote Originally Posted by yamangman View Post
    Not too sure how you reckon LINQ to SQL is data store agnostic, when it runs against SQL Server only, and how you can recommend it, when it is going to be dead and redundant in a few months.
    http://code.google.com/p/dblinq2007/

  10. #10
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: Curious as to the "correct" way

    Quote Originally Posted by directhex View Post
    dblinq is pretty broken.
    To err is human. To really foul things up ... you need a computer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Just curious
    By Funkstar in forum SCAN.care@HEXUS
    Replies: 2
    Last Post: 13-07-2007, 08:15 AM
  2. Curious
    By Harkin in forum SCAN.care@HEXUS
    Replies: 12
    Last Post: 02-05-2007, 09:38 AM
  3. Curious Culinary Concoctions - Add Your Recipies Here
    By pr0p4g4nd4 in forum General Discussion
    Replies: 13
    Last Post: 26-09-2006, 09:45 PM
  4. Curious: Blender aka smoothie recipies
    By 803hart in forum Kitchen and Cooking
    Replies: 8
    Last Post: 24-08-2006, 10:50 PM
  5. Curious George set for October : PS2 and PSP
    By Steven W in forum HEXUS News
    Replies: 0
    Last Post: 12-06-2006, 11:44 AM

Posting Permissions

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