How do I enforce data integrity rules in my database?

前端 未结 11 1455
滥情空心
滥情空心 2021-01-20 04:07

I\'m designing this collection of classes and abstract (MustInherit) classes…

11条回答
  •  日久生厌
    2021-01-20 04:54

    It looks like you are attempting the Single Table Inheritance pattern, this is a pattern covered by the Object-Relational Structural Patterns section of the book Patterns of Enterprise Application Architecture.

    I would recommend the Class Table Inheritance or Concrete Table Inheritance patterns if you wish to enforce data integrity via SQL table constraints.

    Though it wouldn't be my first suggestion, you could still use Single Table Inheritance and just enforce the constraints via a Stored Procedure.

提交回复
热议问题