Dynamic types in a relational model using Object-Role-Modeling (ORM)

In Object Role Modeling (ORM), the specified object that related to an entity of type and where an object of type can be specified for life and the essence of an object can have a meaning for a date of birth, as I would indicate a restriction that would exclude cases where a thing mattered for a date of birth if the instance of the type associated with the thing was not set to a life. See chart below ...

ORM Diagram of a model that should be limited http://img197.imageshack.us/img197/6551/dynamictypeorm.jpg

The purpose of my questions is to allow type modeling within the system when it is not clear what types will be, but the characteristics of the types are known. Your answers should not be in ORM terms if you think there is a more applicable approach. Thanks for reading, hope you can help me.

+3
source share
4 answers

The book John Sanders recommended is one of the best books I've ever read. In addition, all your ORM questions are likely to be obtained by reading it.

To directly answer your question, though (and get around any questions about the validity of the model), there are two obvious ways that I see to keep it as it is.

, , , .

() , , , .

() , , DateOfBirth , . , , , .

alt text http://i43.tinypic.com/zwm59j.png

:
, , -, 'Join Path'. , , . . . , NORMA , , , verbilazation 100%, . , , .

NORMA , , , , , . , , , [#. #], [#]. , , , [1.1] [1.2] /, [2.1]/[2.1]. , , , . , NORMA:
- DateOfBirth; - - , - ; . : - - DateOfBirth; .

alt text http://i41.tinypic.com/24uvxj4.jpg

( ) , , . , , , , , , , , . : OrganicTypes NonOrganicTypes. , , . Note , , . [Thing is of Type] [LivingThing is of OrganicType]. OrganicThings by deffinition , DOB/ , .

alt text http://i43.tinypic.com/2hd1nxs.png

+4

, , , . , - . - , .

, , " " " " ( ), , " , " (Open World , ).

, , , , " " "ORM" "". Object-Role Modeling - , . , , . , , . , .


BTW, ORM, . NORMA. Visual Studio 2005 2008 ( ) ORM2. SQL , ER- .


. :
Halpinbook.jpg

+2

, , , , . , DOB, , DOB NULL, 1.

-:

 function fn_count_living(id)
     declare @count int
     select @count = count(*)
     from entities inner join types on entities.typeid = types.id
     where entities.id = id and types.living = 1
     return @count
 end

 fn_count_living(entity_id) = 1 or dob is null
0

Source: https://habr.com/ru/post/1709924/


All Articles