Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

(B&S)The find() method

 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
In order to implements the find(), could I use the approach of Max's book?Send in the parameter you want to query and based on Name and location, send the result back as int[]? Is it this simple, or do we have to really do some work here?And please if i am wrong about the approach, could someone please give me a push in the right direction on how i shoud accomplish this. Thank you.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Saheed,

How does this fit with your assignment's method signature for the find() method?

Regards, Andrew
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andrew Monkhouse:
Hi Saheed,

How does this fit with your assignment's method signature for the find() method?

Regards, Andrew


Thanks Andrew! I dont understand your reply, but i will try as much as possible to answer your question(correct me if i am wrong). In Max's book, he has a method that returns all the states of the Dvd objects in the File and compares the query he sends with the name of the object(Pls correct me if i am wrong). My find() accepts an array and does a comparison within a file. I was thinking i could do the comparison with the cache that i am using and using that the record numbers wouldnt be hard to get out of the cache. Pls hope i am making some sense here! Thanks for your help so far.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Saheed,

I guess I am a bit confused as to what parts of the DVD search functionality you were referring to. Looking at the DVD search functionality I considered:
  • The DVD search accepts a single string (more on that string later). Any record with any field that matches that string is considered to match the request, and is returned.


  • In contrast, the B&S assignment requires you to be able to search on particular fields (according to the Data specification), and on the name and/or location fields specifically (according to the GUI specification). I think it would be unnacceptable if someone wanted to search in the name field and got a result back where the data only matched in the location field (or even worse, only matched in the specialities field.

  • The DVD search string contains a regular expression.


  • While using regular expressions can provide powerful searching (for example, the "begins with criteria[n]" could be defined in a regular expression (but it could also be handled by String's startsWith() method)), you may want to consider whether this powerful feature should be provided to the end user (who may not have ever seen regex before) or whether they would be better having some other method of entering their search criteria?However, I see that you may not be talking about this at all.
    I was thinking i could do the comparison with the cache that i am using and using that the record numbers wouldnt be hard to get out of the cache.
    This could work very easily.

    Regards, Andrew
     
    Saheed Adepoju
    Ranch Hand
    Posts: 267
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi all
    Thanks Andrew, you got how i was feeling and i got my perfect answer. I will start work on the find() probably today1You are a wonderful teacher. Thanks alot. Have a nice day.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic