• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Thoughts on Prototype pattern for DB?

 
Morgan Bath
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Initially I wanted to use singleton pattern creating a single instanceDB to reduce file access at object creation (I plan on using cache db), aswell as to simplify the locking mechanism. But over the last few hours Ive wondered about using a prototype pattern for a multi-instance database. Any thoughts?
I was also toying with the idea of a singleton Database but a multi-instance DatabaseAdaptor object that uses the Prototype pattern and has the data cache in that object, but all persistence applied through the single database object. This would allow efficient and fast responce for all client requests for records and searches etc, and provide secure, simple but perhaps less speedy bookings and unbookings.
Too much? Too silly? Perhaps exlaining this hybrid between single and multi-instance runs the risk of being too messy to document?
btw, please feel free to tell me to shush when the questions get too bizarre, its late and ive had way too much coffee.
 
Morgan Bath
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can ignore this thread unless you are intellectually curious or have more time on your hands than sense Ive already dismissed this because im 99% sure im not having a search function in the database but instead having the same functionality provided by a filter in the gui.
Basically seeing as Id planned to have the gui default to showing all contractors ive already downloaded the full DB to the client. Seems more efficient to treat the tablemodel as the DB for search reasons. Im not worried about database changes not appearing in the client as it will just mean if someone tries to book something thats just been booked (or deleted) the db sends a message back saying "too slow, no cigar". I am making the assumption that new contractors are added infrequently (perhaps daily at most).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic