in

The ORM Foundation

Get the facts!

Reverse engineering

Last post Tue, Nov 28 2017 17:29 by jess972. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • Tue, Nov 28 2017 14:25

    • jess972
    • Top 150 Contributor
    • Joined on Sat, Sep 2 2017
    • Posts 3

    Reverse engineering

    Hi everyone, 

    When I try to obtain an ORM model from an Oracle database, there is only an unique verb that appears which is "has". Each object type is linked by the predicate "has".

    I would like to know if it is possible to have another verb during the reverse engineering. In case of it is possible, what have I to do in the SQL model ?

    My objective is to personnalize the predicate from the database, in order to have another verb than "has".

  • Tue, Nov 28 2017 16:02 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 729

    Re: Reverse engineering

     In ORM, the "has" is the predicate of the fact type that links the two object types.

    You can change the predicate in the object-role after you have imported the database schema into NORMA.

    I suggest that you use the verbaliser in NORMA to review every fact type and constraint in the schema.

    You can also use NORMA's report generator to see a complete definition of the schema.

     

     

  • Tue, Nov 28 2017 16:43 In reply to

    • jess972
    • Top 150 Contributor
    • Joined on Sat, Sep 2 2017
    • Posts 3

    Re: Reverse engineering

    Alright thank you for your answer.

    And do you know if it is possible in NORMA to import a file containing the verbalizer of the schema ?

    I would like to automate the process instead of enter manually each predicate. 

  • Tue, Nov 28 2017 17:21 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 729

    Re: Reverse engineering

    To the best of my knowledge, NORMA imports what is in the catalog of an RDBMS schema. So what you are seeing in the object-role model is what is in the RDBMS catalog. Thus there is no way automate the import of what is not there in the first place.

    It's a long time since I looked at the code but I suspect that the import code may use  "has" as a default predicate.    

    One of the aims of NORMA's reverse engineering feature is to allow a NORMA user to "Audit" the contents of an RDBMS schema.

    For example, suppose you imported a schema that contained the fact type "Student (.nr) has Address(.nr)"
    You could change this to "Student (.nr) lives at Address(.nr)"
    or
    "Student (.nr) was born at Address(.nr)" 

    If the two addresses are different, and you need to record both types of facts, then you create two fact types and change the schema accordingly.
    This may have a knock-on effect that requires changes to the code that is used to read and write to the database. 

    In my experience, many database schemas are not well designed.
    This means that auditing a database is sometimes a lengthy and detailed process  

    The ORM audit process enables "domain experts" to validate what the database schema "really" says and then to do what is necessary to get it right.

      

  • Tue, Nov 28 2017 17:29 In reply to

    • jess972
    • Top 150 Contributor
    • Joined on Sat, Sep 2 2017
    • Posts 3

    Re: Reverse engineering

    Ok, I have a better understanding.

    Thank you very much. 

Page 1 of 1 (5 items)
© 2008-2017 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service