Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,552
    Thanks
    80
    Thanked 4,492 Times in 4,456 Posts
    Quote Originally Posted by Airblader View Post
    @ Old Pedant

    The OP was very clear on this:
    Originally Posted by handy44
    Its not necessary that the user sees if the movie is rented or not
    And that's exactly what makes it look like homework, to me. I simply can't imagine the usability or usefulness of a system that is unable to tell you if the movie is truly available. I don't rent movies, but I visit Barnes & Noble, and when I ask at the help desk is a given book (or DVD or whatever) is available, they are able to tell me exactly how many are currently IN THE STORE. Same thing at Home Depot, when I want to know if a given light fixture is available. Not only do they know how many are in stock in the store, they know how many are in stock in any store in the country, including especially those within a few miles. Without that information, the help desk would be nearly useless.
    Last edited by Old Pedant; 12-01-2013 at 10:32 PM.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  2. #17
    Regular Coder
    Join Date
    Jan 2013
    Location
    Germany
    Posts
    578
    Thanks
    4
    Thanked 77 Times in 77 Posts
    Yes, agreed – it certainly does sound odd. And could likely be homework. On the other hand I'd respect a teacher who provides a list of 40,000 titles rather than just a few. In any case: homework or commercial situation, I don't post full solutions.

  3. #18
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,146
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    The OP was very clear that

    "I'm working in a movie rental store, and my boss asked me to build an online app where the user can enter a specific title, and then the app will confirm if we got the title in store or not." That means either that the store does not stock that title, or it does stock it but it already rented out to another customer. I interpreted "Its not necessary that the user sees if the movie is rented or not" to mean that which of those two possibilities applies is not to be revealed to the customer.

    Nowhere have we discussed how the database is to be updated when a customer rents or returns a movie. IMO there must be a server-side database.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  4. #19
    Regular Coder
    Join Date
    Jan 2013
    Location
    Germany
    Posts
    578
    Thanks
    4
    Thanked 77 Times in 77 Posts
    I didn't think about interpreting it that way, but it makes sense (though there could be a simple article missing and then "if we got the title in the store or not" has a whole other meaning). it certainly couldn't be done by just serving/duplicating the XML file then.

    I'll just reiterate that no matter what, I don't think copying any data is gonna do any good.

    Greetings from the dotJS in Paris

  5. #20
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    And that's exactly what makes it look like homework, to me. I simply can't imagine the usability or usefulness of a system that is unable to tell you if the movie is truly available. I don't rent movies, but I visit Barnes & Noble, and when I ask at the help desk is a given book (or DVD or whatever) is available, they are able to tell me exactly how many are currently IN THE STORE. Same thing at Home Depot, when I want to know if a given light fixture is available. Not only do they know how many are in stock in the store, they know how many are in stock in any store in the country, including especially those within a few miles. Without that information, the help desk would be nearly useless.
    Thanks for all the comments! I see some very useful things! I haven't readed them jet, i will later today.
    I can guaranty that this isnt a school project. I'm still on school tho, but I like to figure things out myself, and I get the time to do that at school. This app I got to build for my job, has to be builded asap. And I couldnt find any usefull script on the internet. So thats why i registered on codingforums, hoping you guys could help me. And so you all did! Thanks again for all the replies!

    And if you still believe this is a school project, i can add 'codingforums' as a metatag on my jobs official website, as proof

  6. #21
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    Nobody past Philip's first response has bothered to address the problem of "stock level". Yeah, there might be 40,000 titles available. But after you sell the last copy of "Hunger Games", how can you sell another one? Same applies to rental. You allow the user to look up the title, but how will you or he know if the title is actually in stock at the store to rent.

    This whole thing, including doing it with XML, reads like a homework assignment, to me. I can't imagine basing a REAL store on something built in this manner.

    Airblader: Yes, MySQL can do Soundex searches. You will get more results than you want, but you will find most misspellings.
    http://dev.mysql.com/doc/refman/5.5/...nction_soundex
    The genealogy site RootsWeb.com uses MySQL and Soundex to find spelling variations in surnames with a lot of success.
    The stock level isn´t necessary, really. If the customer comes for a movietitle, and we dont got it in stock, then we´ll give the customer the option to reserve the movie when it comes back, we will also call the customer that the movie is back in store.
    Also the movie rental industry isnt going well, because of downloading and home tv movie rental systems. We got at least 2 in stock for every movie, so the chance that the movie is out of stock is not very big.

  7. #22
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,552
    Thanks
    80
    Thanked 4,492 Times in 4,456 Posts
    Well, then, I'll shift gears and suggest your boss may not know what he *really* needs/wants. You will deliver a solution that does only and exactly what he asked for and the next thing you know he will want you to implement the "what's in stock" that experience tells us he *will* need in the future.

    But maybe not. Who knows.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


 
Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

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