I would like to be able to do somthing like the following:
//non-generic var MyTable = new Table(); string name = MyTable.Name; IEnumerable<String> rows = MyTable.Rows; //generic var MyTableGeneric = new Table<MyType>(); string name = MyTableGeneric.Name; IEnumerable<MyType> rows = MyTableGeneric .Rows;
Would something like this be to much:
http://img81.imageshack.us/img81/427/diagramcm3.jpg
or would this be better:
http://img301.imageshack.us/img301/4136/presentation1nh9.jpg
Sorry if this hard to understand what I am trying to get at, basically I have two objects will share comman properties except for there row collections which will be generic. I would like to do this in cleanest way.
Sorry for my crappy diagrams, made in powerpoint 🙂
I’d say the second design is better. Less items and easier inheritance path.
The first design has unnecessary interfaces, which you don’t really need unless you’re implementing something else which implements the interface, but doesn’t inherit from the base class.