• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I catch a mistake in the specification

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will consider this as a mistake. In the criteriaFind() implementation, it mentions by example that the method should be able to accept the argument string "Carrier='SpeedyAir',Origin='SFO'". Strictly speaking, there is no such field name as "Origin" in the database. The correct form should be written as "Carrier='SpeedyAir',Origin Airport='SFO'". The method I implement will return field name not found message. This is my thought.
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the format of the message was the intent of the example, not the actual content. You're right in that Origin does not exist and it would return 0 data. You're throwing an exception which is fine. I don't have the assignment available in front of me right now but I thought it stated that any errors in the search criteria string should yield the same behavior as an empty result set.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rudy,
I think the Sun example was just that - an example. In my assignment (where we have to do a data conversion utility), the specific field names are specified by the developer anyway. Sam is correct in that the spec says when "an invalid field name being provided as part of the criteria the behavior of this method is the same as if no records matching correctly specified criteria" were found. Not sure about your "message" approach in that case, since if no records are found I would just return a null array not any type of message.
Jeff
 
Rudy Yeung
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What data conversion in the assignment you are refering to? I cannot find anything related to data conversion in the specification. Do I miss something in my assignment?
Rudy
 
Jeff Young
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably not. As I understand it there are 2 versions of the FBN assignment - one where you are supplied a text file and you need to write a conversion routine to generate a binary file and one where the binary file is supplied. I have the first one and had to write the conversion program. In doing so, the field names are not specified and I could call them whatever I wanted, so that's why I think the example from Sun is just a guideline as far as the exact field names.
Jeff
 
reply
    Bookmark Topic Watch Topic
  • New Topic