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

B&S UI & Data.java

 
Chris Hani
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have got B&S problem which basically search contractors(search DB) and book one of them(Update DB). And UI requirement says that I must search data with some conditions or not, book a selected record and update file accordingly.

But in Data.java there are two methods that are not going to be used, I think.
public void delete(int recordNo)
public int create(String [] criteria).
As far as I know, the interface Data.java must be implemented.

Does it means I must implement those methods even if I do not use it?
Or
Shall I implement all expected related DB action in UI like create a record when a new contractor joins this company or delete a record when a contractor doesn't work any more??

 
Jared Chapman
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I implemented both create(String[]) and delete(int, long) in Data.java, but my UI does not use them at all.

Your data access class must be called Data.java, must be in a package called "suncertify.db", and MUST implement the following interface...


To me, this means that all the methods in the supplied interface must be implemented.

As far as the UI is concerned, I did not provide the ability to add/remove contractors. It is simply not in the specifications, and going beyond the requirements could be a bad thing.

Also, here is another possible justification for implementing create and delete in Data.java, even though these methods are never used by the UI. Perhaps, in the future, someone will want to write another program for an administrator to use to add and remove contractors from the database. This isn't necessarily something a customer service representative should be allowed to do. By implementing create and delete, this new program could simply use your Data class as it is.

Anyway, that's what I think. Hope this helped.
 
Kai Witte
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

I recommend to keep the implementation within the scope of the requirement: Let create and delete throw an UnsupportedOperationException. Make sure you document the interface ("optional operation") and the implementating class appropriately.

For me it payed off (no points lost in related areas) as well as for everyone else I heard about (2 or 3 ppl). I had B & S 2.3.2.

Conan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic