This will be a somewhat abstract question.
I am working on an Access Access database that should distinguish between a table, its abstract layout / layout and specific table entries. I am afraid that because of this difference there will be a lot of code duplication. I may need some information on ways to avoid this.
+-----------+
| Foo |
+-----------+
| +Id: Guid |
+-----------+
Note that in this diagram you can describe any of them: a table schema, a specific table, or a specific table record that has a Idtype field Guid.
- All that is known in the schema is the name and type of the field.
- In the specific (open) table, the field "column index" is additionally indicated.
- , .
, ( ). , ; , , - :
interface ISchemaField<T> { string Name { get; } }
interface ITableField<T> { string Name { get; }
int Index { get; } }
interface IRecordField<T> { string Name { get; }
int Index { get; }
T Value { get; set; } }
interface IFooSchema
{
ISchemaField<Guid> Id { get; }
IFooTable Open(IDbConnection dbConnection, string tableName);
}
interface IFooTable
{
ITableField<Guid> Id { get; }
ICollection<IFooRecord> ExecuteSomeQuery();
}
interface IFooRecord
{
IRecordField<Guid> Id { get; }
}
. ?
(, T4), , "" ( ) .
, , ... .