[4GL/ABL] Reverse: from DB's schema to table's relationship is possible?

Good morning to all guy! :)
I'm a new italian user of OpenEdge SW suite, so sorry for my bad english. :(
I come from C, PHP and SQL languages and now i start to work with OE.

My team received a lot of SW to debug (), but don't exist the relative documentation and so we are scared to mod part of the code because we ignore the side-effect of the mod. ;(

I ask to you if is possible rebuild the relationship starting from the DB, a kind of:
TABLES
--->
E-R SCHEMA
[IMG]http://img223.echo.cx/img223/1542/eerproject5vo.gif[/IMG]


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

E-R SCHEMA

For this target i use erwin data modeler(CA), but for large schema DB the processing is very slow.


tamhas's picture

OpenEdge does not carry

OpenEdge does not carry foreign key information in the database. You need to get that empirically from the code. You might want to look at the Joanju Analyst product and the material on this site for UML modeling from existing ABL code. I will be making a bunch of updates to this very soon, so check in more than once.


not likely...

What you want to achieve is not entirely possible.
Although you can reverse engineer some information from database schema, certain information like constraints, cardinality etc. is maintained by the ABL database trigger code.
That's under assumption that you inherited database created/maintained using Data Dictionary / ABL.
What you could do is to reverse engineer database using some tool (e.g. Erwin), analyze
database trigger code and then add that information to the ER diagram. From that point on you could forward engineer database and Erwin would create data definition file and database trigger code. However there is number of gotchas with this approach and there are other tools available which could be used as well, but as far as I know it is not going to be straight forward process.

Good luck & ciao,
Sasha


Matrixbob's picture

Other solutions or other

Other solutions or other solutions with SW freeware/opensource exist?


tamhas's picture

As noted above, no tool,

As noted above, no tool, free or otherwise, is going to create relationship data that isn't there. There are some hacks, like guessing that common field names between tables might mean a foreign key relationship, but how well those work depend on your particular schema. Two obvious problems with this are schemas that have common audit trail in many or all files, thus producing thousands of false joins or schema like I understand MFG/Pro has, where columns carry a table prefix, so every column name is unique and no relationships are found.

With the ABL to UML tool, though, one does have the WHERE clauses for all table accesses, so systematically sifting through those would give you all of the relationships which are actually used (as opposed to being a part of the design and never actually used). I suppose that if some effort were put into the project described here http://www.oehive.org/node/1112 that you could get this information without going into the UML aspect, but it is still going to be just the raw material and you are the one who is going to have to piece together the relationships. I suppose it is possible to think about a tool that would parse those WHERE clauses, but it won't be a trivial task.


Matrixbob's picture

A method that use a chain of

A method that use a chain of tools is already a good thing!

So, while i learn to use some of this kind of tool, if someone want to write and continue about this topic i'll be grateful and debtor.

.... always .... tnx.


In my case, I decided to

In my case, I decided to write an ABL script to generate an XML file compatible with Dia (http://live.gnome.org/Dia). This was able to generate tables, attributes and primary keys, and with this information I was able to manually draw the relations in Dia.
I did attempt to programmatically 'guess' the relations, but as Tamhas mentioned it's not a simple job and probably won't always be right!

If you would like to see my script (including relation attempt) just contact me and I'd be happy to share.


Db Relationship

Can you try to use Erwin Data Modeler (CA). This tool read relationship from db schema and do in output a very lot of options and graphics.


Matrixbob's picture

I have do a search on the

I have do a search on the Web and i have found other SW for ER modelling and management.

01] ERWin (pagamento 4000$)
02] Open System Architect
03] DDS (pagamento 400$ - 100$)
04] DIA
05] Java Diagrammi ER
06] Rational rose (non trovato)
07] EasyCase (non trovato)
08] Visual Modeller (non trovato)
09] DBDesigner
10] MySQL Workbench


tamhas's picture

Yes, but a tool that does ER

Yes, but a tool that does ER modeling doesn't necessarily support OpenEdge ... most don't. And, you should include Enterprise Architect in the list.