System Design Tools
-
Upload
guo-albert -
Category
Technology
-
view
702 -
download
9
Transcript of System Design Tools
System Design ToolsAlbert Guo
12009年1月4日星期日
Agenda
Scenario
System Design Process
Design ER Diagram by JDeveloper
Generate DB schema diagram via SchemaSpy
Generate artifacts by MyEclipse
Refactor artifacts automatically via ant
Q&A
22009年1月4日星期日
Scenario
32009年1月4日星期日
System Design Process
42009年1月4日星期日
Design ER Diagram by JDeveloper
52009年1月4日星期日
JDeveloper Studio
JDeveloper StudioIt contains all the features of the product - including ADF, SOA, J2EE, UML, Database, Java, and XML. This download includes JDK 5.0.5 and is supported on Windows XP, 2003 and 2000.
I used this tool to do schema design and draw ER diagram. It will create / update / delete tables, columns and constraints synchrnously as I edit ER diagram.
62009年1月4日星期日
JDeveloper Studio
Download: http://www.oracle.com/technology/software/products/jdev/htdocs/soft10131.html
Documentation: http://www.oracle.com/technology/documentation/jdev.html
72009年1月4日星期日
82009年1月4日星期日
Generate DB schema diagram via SchemaSpy
92009年1月4日星期日
SchemaSpy
SchemaSpySchemaSpy is a Java-based tool that analyzes the metadata of a schema in a database and generates a visual representation of it in a browser-displayable format.
Download: http://schemaspy.sourceforge.net/
SchemaSpy requires:1. Java 1.4 or higher
2. Graphviz: http://www.graphviz.org/
I use ant to execute command to generate schema document.
102009年1月4日星期日
SchemaSpy
Regarding its commands, please go to here to check: http://schemaspy.sourceforge.net/I had integrated its commands into ant script, so I can reuse it easily.
112009年1月4日星期日
Ant build script
<?xml version="1.0" encoding="UTF-8"?><project name="schemaspy" default=" schemaspy "> <property name="reports.dir" value="C:\rs-schema"/> <tstamp> <format property="CURRENT_DATETIME" pattern="yyyy/MM/dd HH:mm" /> </tstamp> <target name="schemaspy"> <java jar="D:/jar/schemaSpy_4.1.1.jar" output="${reports.dir}/output.log" error="${reports.dir}/error.log" fork="true"> <arg line="-cp d:/jar/ojdbc14.jar;C:/Program Files/Graphviz 2.21/bin"/> <arg line="-t orathin"/> <arg line="-host 10.9.164.101"/> <arg line="-port 1521"/> <arg line="-db RSDB"/> <arg line="-u username"/> <arg line="-p password"/> <arg line="-s RSDB"/> <arg line="-o ${reports.dir}"/> <arg line="-ahic"/> </java> <tstamp> <format property="CURRENT_DATETIME" pattern="yyyy/MM/dd HH:mm" /> </tstamp> <echo>Schema Report had been generated to ${reports.dir} at ${CURRENT_DATETIME}</echo> </target>
122009年1月4日星期日
SchemaSpy Analysis Report
list all tables in this list
132009年1月4日星期日
SchemaSpy Analysis Report
show the table relationships
142009年1月4日星期日
Generate artifacts by MyEclipse
152009年1月4日星期日
Generate artifacts by MyEclipse
Artifacts includeEntities
DAOs
persistence.xml
162009年1月4日星期日
select tables which you want to do DTO generation in database explore view
172009年1月4日星期日
decide these artifacts will be generated into which project and in which package
check this checkbox to tell MyEclipse to geneate DTOs, and also update these DTOs to persistence.xml
click Finish button to get DTOs generation process done.
182009年1月4日星期日
MyEclipse had generated DTOs and also updated its persistence.xml
192009年1月4日星期日
DTOs which generated by MyEclipse. It just full of getter and setter method.
202009年1月4日星期日
Then we go to Database Explorer view to generate DAOs
212009年1月4日星期日
decide these artifacts should be generated to which project and which package.
check this checkbox to tell MyEclipse to generate DAOs
Click on the Finish button to get the DAOs generation process done.
222009年1月4日星期日
The artifacts which had been generated by MyEclipse
232009年1月4日星期日
These methods which had been generated, you may can customize it to fulfill your requirements.
242009年1月4日星期日
Refactor artifacts automatically via ant
252009年1月4日星期日
Refactor artifacts automatically via ant
Refactor rules for entities1. implement one more interface: Persistable
2. import one more class: import ht.fc.entity.essential.Persistable;
3. modify object ID generation rules: @Id@TableGenerator(name = "IDGEN", table = "htsequence", pkColumnName = "sequence", allocationSize=1)
4. eliminate @Basic(optional = false), and its import class
262009年1月4日星期日
Refactor artifacts automatically via ant
<property name="entity.dir" value="D:\work\test\src\java\com\htc\hr\entity"/> <target name="refactorEntity"> <echo>refactor entities...</echo> <replace dir="${entity.dir}" value='@Id@TableGenerator(name = "IDGEN", table = "htsequence", pkColumnName = "sequence", allocationSize=1)'> <include name="**/*.java" /> <replacetoken>@Id</replacetoken> </replace>
<replace dir="${entity.dir}" value=""> <include name="**/*.java" /> <replacetoken>@Basic(optional = false)</replacetoken> </replace>
<replace dir="${entity.dir}" value=""> <include name="**/*.java" /> <replacetoken>import javax.persistence.Basic;</replacetoken> </replace>
<replace dir="${entity.dir}" value='import ht.fc.entity.essential.Persistable;import java.io.Serializable;import javax.persistence.TableGenerator;'> <include name="**/*.java" /> <replacetoken>import java.io.Serializable;</replacetoken> </replace>
<replace dir="${entity.dir}" value="implements Serializable, Persistable"> <include name="**/*.java" /> <replacetoken>implements Serializable</replacetoken> </replace>
<tstamp> <format property="CURRENT_DATETIME" pattern="yyyy/MM/dd HH:mm" /> </tstamp> <echo>refactor entities had finished at ${CURRENT_DATETIME}</echo> </target>
272009年1月4日星期日
Q&A
282009年1月4日星期日