PandaWood wrote:
I don't really understand what you're trying to do from an object oriented point of view. So here's a well-regarded suggestion for designing your domain model "do it exactly as you would if Hibernate didn't exist".
That sounds like generally good advice, but actually I didn’t know anything about Hibernate in particular when designing the domain model. Rather, I just had some vague sense there would be a relational database as the underlying data structure.
PandaWood wrote:
When you say does it support multiple inheritance in this way.. yeah I don't know if there's an answer to this, because what you've talked about is not multiple inheritance. Multiple inheritance is not supported in C# and interfaces are implemented not inherited.
I used the term “multiple inheritance” because some people see implementing interfaces as a scaled-down form of inheritance. I can instead call it “implementing multiple interfaces” if that’s more kosher. But in fact, the effect I am talking about achieving is more than just implementing an interface. I am talking about the data structure being “inherited”, which I think is conceivable in an O/R mapping scenario since the underlying data structure sits outside of the CLR.
PandaWood wrote:
If you don't have subclasses, you cant map subclasses. There seems to be some confusion about what interfaces are here.
Interfaces are not classes, so they don't directly affect mapping at all.
I’m a bit confused by what you say here. In the NHibernate documentation, “Chapter 8: Inheritance Mapping”, the example of table-per-subclass mapping uses exactly that: an interface that’s mapped to a table in the database. And I never said I don’t have subclasses. Quite the contrary, I said my domain model consists of concrete classes that each implement zero to two interfaces.
I hope that’s helped somewhat clarify my question in regards to implementing multiple interfaces. Again, if that’s not possible, then what about user-defined parameterized types?