Readonly Classes November 25, 2005
This is a quick one before I head out to the Great American Pub tonight with some friends. I was writing a way to make simple input screens based off of the information in Dumb, when I realized that when I got that information, I had access to the whole class, and didn't like it. Basically, something that's using the information doesn't necessarily need to manipulate it. So, I abstracted out those classes into interfaces with selected properties that are readonly. The problem was this: I had to update all the references to the class to be references to the interface. It took forever, but I eventually got it, and after touching practically every class in Dumb, it's now almost up to date. I still have to create an "information getter" interface so that I don't have to have direct access to every method in my engine class (I only need to be able to select, insert, update and delete, for now), whereas the engine class has methods in it to create tables and generally access a lot of different stuff that a simple inquiry class doesn't need access to. Also, the engine already implements an interface, but it's a 1 to 1 implementation (meaning, it is just an abstract API interface so you don't have to know which implementation of the engine you are using... I can have multiple engine implementations and just swap one in [like a CachingEngine that doesn't hit the database everytime if it already loaded an object]). So, I'll have to add another interface on top of the engine interface
e.g.
public interface DaoEngine extends InformationGetter
that has just methods to get that info out. Names not final.
After that whole thing's done (including making the automated data input screens), I can work on Attachments. That's gonna be awesome.