Forums Register Login

2 databases?

+Pie Number of slices to send: Send
Hi,
I have a question about the instance of databases:
for example, If I have two db files,
Data d1=new Data(file1);
Data d2=new Data(file2);
so, there should be no static member inside the Data class, right?
for example the lock?
A solution is to use multiton design pattern with the file name as the key.
please comment on my design.
thanks
+Pie Number of slices to send: Send
so, there should be no static member inside the Data class, right?
Well, you might have some static members. E.g. you might have a static HashMap which is part of your multiton design. And of course there may be static constants. But in general most data should not be in static variables, correct.
for example the lock?
A solution is to use multiton design pattern with the file name as the key.
please comment on my design.

Sounds good. This isn't a requirement for the assignment, so don't let this multiton idea get complex; you're not really going to use it much. But it's not a bad idea.
PI day is 3.14 (march 14th) and is also einstein's birthday. And this is merely a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 517 times.
Similar Threads
Locking on a static object
Threads and Databases
Multiple Database Files Support
Advice required on persuing MTech/MS in Comp Science
Hadoop questions ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 20:07:43.