Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

UB: Instantiation of Data class, automatic tests

Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm just wrapping up my project and started to think (seemed like a good time to start thinking ;-).
In my solution there should only be one Data class which all threads should access and it is instantiated with the path to the db-file. If there are multiple instances of the data class which have the same path to the database there is a risk that data may be coruppted.
I have stated this in the documentation but do you think that the code should be changed to take care of this situation. I cant really decide how to do, it doesnt require too much code to fix this but still the code becomes more complex. Also, it feels a bit strange to write code that is not needed in my solution.

What worries me is that in my database code I am in control of how the data class is instantiated but when Sun runs the automatic tests they may have a different approach to how things are instantiated.

Best Regards,
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic