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

NX:[contractor] Stand-alone Data class?

 
Matthew Blaise
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All.
My specs tell me:
"Your data access class must be called 'Data.java'...and implement the following interface:"
It lists the DBAccess interface after this. This looks like it will be the class that the testers will use to run some automatic tests. When I ask myself how they will do that automatically I am led to believe that they will have a test program that creates an instance of our Data class and go from there.
Is this a correct assumption? If so, the Data class must be able to be initiated properly with a "no-arg" constructor and many properties will either have to be hard-coded or looked up in a suncertify.properties file.
So, I guess the real question is: does anyone know if the testers make any attempt to use your Data class as you design it or do they just plug the class in to their code blindly.
Thanx
Blaise
 
Matthew Blaise
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, does anyone's Data class use other classes besides a LockManager class and a RandomAccessFile? I'm thinking of using some kind of storage strategy abstract class and subclassing to implement the methods of accessing tables and having that class return a wrapper representing a table. Any comments? Am I crazy?
Thanx.
Blaise
 
Guido Tapia
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didnt provide a default constructor to my Data.java, this wasnt specified in the specs. I have a sole constructor taking in a File object (referencing the database file). I also have another class that uses the data class, basically a Wrapper and Im using a Record objects to encapsulate the database fields in an Object rather than using String arrays everywhere.
 
Matthew Blaise
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guido.
So you think that they will take your design into account when testing? i.e. pass the necessary File object?
Blaise.
 
Guido Tapia
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought about that. and yeah I initially had a default constructor that passed the other constructor a hard coded db file location, but then I thought that that was a poor design so i removed it. I'm also under the impression that the Data class will be used for auto testing, but its not too hard for them too see that they need to pass a File in the constructor. I'm sure that if they had a really strict auto-testing app they would have put the requirement for a default constructor in the specs. But still this is speculation as I havent submitted my assignment yet, but I'm going with the no-default constructor approach unless someone can share some more light on this issue.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you think that they will take your design into account when testing? i.e. pass the necessary File object?
They'd better, since they failed to specify anything about constructors for the Data class. (Unlike the specs for new Exception classes, which are fairly specific.) Requiring a File or String (for file name) is perfectly reasonable, IMO. As it happens, I also provide a default constructor that uses the name of the data file they provided - but I consider that for my own convenience only. There's no valid reason for them to mark you down for not having a no-argument constructor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic