Ok, after much debate I reckon I will go with the following solution for my Data Access Layer.
My data class has the following members:
1. Shared single RAF for file access and locking
2. Shared single Collection for record Locking
3. Shared DBMetaData class ( singleton ) for establishing db schema information
4. Shared CookieGenerator class ( singleton ) for generating unique lock cookies
You can create multiple instances of Data Class
My Data class is wrapped inside a DBAdapter class ( using the SUN DBAccess interface as reference type ) which implements a DBClient interface ( Adapter
pattern )
Now I am debating wether to extract the File IO jobs ( read record / update / create record etc ) into a DbIO class. Do you think there is any benefit in this??
Also, currently my DBMetaData class ( singleton ) is responsible for configuring itself ( reading in the db schema and setting instance vars etc). Now i am not sure wether to leave this or to just use the DBMetaData class as a holder and give my Data/DbIO class( if i go down that route ) the responsibility of reading in the db schema??
Please let me know what you think.