posted 18 years ago
All access to your data must go through the Data class. That means that regardless of how it works in the underlying structure, a call to Data.update(), or Data.unlock(), or Data.lock(), etc... must preform as specified by the interface.
If I am understanding you correctly, your Data.update() method calls DataAccess.update(), and your Data.lock() calls LockingManager.lock(), etc... right? I see no problem with doing it this way, as you are still fulfilling the requirements of the DBMain contract.
Personally, I implemented both the manipulation and locking mechanisms in the same class, but I see the advantages to your solution.
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook