For the URLyBird assignment i've come up with the following design. I was just wondering if i'm not over-complicating things.
I have a Data class implementing DBMain. This class handles all IO and is able to (un)lock records by a simple lock flag implementated in a Vector.
Because the
String arrays are to close to the file structure, i implementated the column, schema, field and record classes.
I have a GenericColumn interface and a ColumnInfo class implementing the interface. The interface exposes getFieldName and getWidth.
The RecordSchema exposes getColumnCount and getColumnSchema. The column schema is an array of GenericColumn. SchemaInfo implements this interface and holds the array of columns.
The Field interface extends GenericColumn and adds getFieldValue and setFieldValue methods. The FieldInfo class implements this interface.
The Record class implements GenericRecord. This interface exposes functions to query the schema and field values. It also adds a unique id to the record.
The connection classes (remote and local) expose methods for retrieving records and update records (and all other functions that compare to DBMain) The difference with DBMain is that the connection class works with the Record schema i described above in stead of the string arrays. A huge advantage is that the schema validation is handeld by the record schema before the data is provided to the Data class. Also for building a client it is more intuitive to work with records in stead of string arrays.
Please tell me what you think of this design.