Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Modifying Find

 
Matt DeLacey
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are we allowed to modify the find method in the Data class for FBN assignment? I think older FBN assignments don't have a find method, but mine does. It seems TOTALLY useless. Maybe overloading it would be better? Any comments?
Matt DeLacey
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need to modify it in the first place? My assignment says nothing about the modification of any methods exception deprecations, lock and unlocking, and add criteriaFind. I don't see why you need to change it at all.
 
Jerry Pulley
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt,
find() was really useful in my unit tests.
Jerry
 
Matt DeLacey
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jerry. Adrian--> The reason I wanted to modify it, was because it is useless to me now, but if I made some minor modifications it could do a lot of the work of my criteriaFind method. Anyway, the directions don't say anything about modifying find, but they don't say anything about NOT modifying it...?

With Respect,
Matt
 
Mohnish Sharma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not think you should use Data.find() to implement your criteriaFind() method.
From what I understood, find() looks for the first instance of the search criteria and returns the record. I think this will work fine if each record has a unique field like Flight number.
This method will not work if the data structure is:
Flight Origin Destination
1 LAX SFO
2 SFT LAX
We will not be able to find flights arriving in LAX. Using this method, we will always hit record one and never be able to reach record 2.
I am waiting for your comments.
Mohnish
------------------
 
Matt DeLacey
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree 100%. That is why I wanted to modify it. But I guess I have decided to let it be and overload it instead.
With Respect,
Matt
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic