|
|
Home » Community » Coffee corner » Automatic generation of SCH-file from UML
Automatic generation of SCH-file from UML [message #22982] |
Fri, 04 September 2009 14:26  |
|
I do not know in what forum section to put this topic.
I made for myself adapting to the program Dia, that it can generate code sch-file on UML diagrams.
Example of the complex structure of the tables, such as here,
you can immediately get ready sch file in the form:
//======================================================================================//
// //
// COMPANY //
// //
//======================================================================================//
TABLE_(COMPANY)
#ifdef MYSQL_DB
TABLE_SUFFIX("CHARACTER SET utf8 COLLATE utf8_general_ci\n")
#endif
INT_ (COM_ID) PRIMARY_KEY AUTO_INCREMENT
INT_ (COM_GROUPID)
STRING_ (COM_NAME,500)
STRING_ (COM_INN,500)
STRING_ (COM_KPP,500)
STRING_ (COM_COMMENT,500)
END_TABLE
//======================================================================================//
// //
// ACCOUNT //
// //
//======================================================================================//
TABLE_(ACCOUNT)
#ifdef MYSQL_DB
TABLE_SUFFIX("CHARACTER SET utf8 COLLATE utf8_general_ci\n")
#endif
INT_ (ACC_ID)
INT_ (ACC_CORRID)
INT_ (ACC_BANKID)
STRING_ (ACC_NAME,500)
STRING_ (ACC_ACCOUNT,100)
STRING_ (ACC_COMMENT,500)
END_TABLE
//======================================================================================//
// //
// BANK //
// //
//======================================================================================//
TABLE_(BANK)
#ifdef MYSQL_DB
TABLE_SUFFIX("CHARACTER SET utf8 COLLATE utf8_general_ci\n")
#endif
INT_ (BNK_ID)
STRING_ (BNK_NAME,500)
STRING_ (BNK_BIK,100)
STRING_ (BNK_CORRACCOUNT,100)
END_TABLE
....
....
The same description of the other files.
....
....
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
[Updated on: Fri, 04 September 2009 14:29] Report message to a moderator
|
|
|
|
Automatic generation of SCH-file from UML [message #22988 is a reply to message #22982] |
Fri, 04 September 2009 15:02   |
|
The method is very simple.
1. Setup the program Dia. (http://projects.gnome.org/dia/)
2. Set the updated script codegen.py in the folder
/usr/share/dia/python/ from Attachment
3. Compile all the scripts in the directory
/usr/share/dia/python/
command: (if necessary, manually remove codegen.pyc before compiling).
4. We follow the simple rules for creating UML diagrams in the program. Here is the description of one table:

5. Click File -> Export, select the type:
PyDia Code Generation (U++ Sch) (*.sch)
6. We enjoy the results.
PS.
All this was done in UBUNTU 9.04
How to do the same for Windows, I do not know.
PSPS
If you need more detailed descriptions and instructions, I am pleased to share.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
[Updated on: Fri, 04 September 2009 15:21] Report message to a moderator
|
|
|
Automatic generation of SCH-file from UML [message #22989 is a reply to message #22988] |
Fri, 04 September 2009 15:08   |
|
The most important thing.
1. This file - codegen.py
must put in a folder
/usr/share/dia/python/
2. remove from this folder codegen.pyc
3. Start compiling all scripts in this folder
4. Dia is ready to export sch-files.
-
Attachment: codegen.py
(Size: 11.45KB, Downloaded 1292 times)
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
[Updated on: Fri, 04 September 2009 15:21] Report message to a moderator
|
|
|
Re: Automatic generation of SCH-file from UML [message #22990 is a reply to message #22989] |
Fri, 04 September 2009 15:14   |
|
Of course this way imperfect.
Frankly, I made it for 15 minutes.
And maybe someone will propose how to improve it.
I just like the tool has long wanted to do or how to get something.
Very sad without visual aids to design the database from the set of related tables.
In general, want to see suggestions for improvement.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 18:06:24 CEST 2025
Total time taken to generate the page: 0.00753 seconds
|
|
|