Java Forum / Databases / May 2007
Read (and Visualize) Database Schema
send.me.all.email@googlemail.com - 17 May 2007 14:10 GMT Hi experts,
which approaches would you suggest for:
- Reading a database schema (tables, fields, relationships) from SQL Server 2005? - Visualizing the DB schema?
For developing a DB tool (Eclipse plug-in) the schema should be read from the server and then be visualized, e.g. like the SQL Server BI Development Studio does when importing the whole schema to a data source view.
Any ideas or hints on how to start approaching this (either reading schema and/or visualizing it) are welcome!
Regards, Max
Christian - 17 May 2007 14:19 GMT send.me.all.email@googlemail.com schrieb:
> Hi experts, > [quoted text clipped - 14 lines] > Regards, > Max Well visualization. How about doing it like an Entity-Relationship model... thats at least one Visulaization that comes to my mind .. may be you want more..
Christian
send.me.all.email@googlemail.com - 18 May 2007 13:44 GMT > Well visualization. How about doing it like an Entity-Relationship model... > thats at least one Visulaization that comes to my mind .. may be you > want more.. No, in contrast, I want less. :-)
Generating an ER model based on a given database schema would require some model transformation or reverse engineering approaches (e.g. to decide if a concrete relation could have been introduced to realize a weak entity or a multivalued attribute).
The kind of visualization I have in mind is just an easy to understand graphical 1:1 representation of the schema. Something like: Tables are depicted as boxes, containing the fields of the table as rows showing the name and type of the field. Fields acting as primary or foreign keys are specially marked. Relationships between tables are depicted as lines connecting the tables. If the name of a relationship and the cardinality information are given, then these should also be included as labels to the relationship lines. The visualization of the database schema should then allow the user to select tables by clicking on them and perform basic operations on them.
So this should be no rocket sience, but as I never built such a tool before, I'm quite interested in what is the current state-of-the-art- approach to do this. Building an Eclipse-PlugIn using EMF? Which frameworks to use to minimize the development effort?
Any ideas?
Regards, Max
Martin Gregorie - 18 May 2007 14:53 GMT >> Well visualization. How about doing it like an Entity-Relationship model... >> thats at least one Visulaization that comes to my mind .. may be you [quoted text clipped - 24 lines] > > Any ideas? As you say, this seems quite doable - the JDBC metadata retrieval functions should be able to return most of what you need, though you may need to rethink the GUI. It may be enough of a problem to draw a readable ER diagram (where E=table, R=fk) showing just the table names from a decent sized schema and disentangling it so not to many relationship lines cross could be quite difficult. You may want to show table properties (columns, keys, indices, etc) only by clicking on a table and the same for a relationship.
Are you familiar with the Embarcadero (http://www.embarcadero.com) tools? If not you could do a lot worse that download an evaluation copy or two. Some of their stuff may be what you need and failing that you'll surely get some ideas by playing with it.
If you may find that automatically producing a schema diagram that isn't a tangled mess is sufficiently difficult that the way to go is to let the user drag objects around to make the diagram readable and then save the result. On start-up it should be easy enough to compare the saved model with the actual schema. If they are the same there's no problem: just show the hand-modified version. If they differ you'll need to do something about it: either replace the diagram entirely or just patch it to match the schema, again letting the user change any tangled bits.
HTH
 Signature martin@ | Martin Gregorie gregorie. | Essex, UK org |
send.me.all.email@googlemail.com - 20 May 2007 22:52 GMT > [...] showing just the table names from a decent sized schema and > disentangling it so not to many relationship lines cross could be > quite difficult. Yes, you are addressing a very important point. Finding a framework for just creating a visualization somehow is one thing. Getting a neatly layouted schema representation is way more complex, if we assume this framework doesn't offer ready to use layout algorithms (layouter) right out of the box.
> Are you familiar with the Embarcadero (http://www.embarcadero.com) > tools? No, not yet, but a graphical representation and a layout like e.g.
http://www.embarcadero.com/news/product_photos/ERStudioOverview_HiRes.jpg
would be quite perfect.
> If you may find that automatically producing a schema diagram that isn't > a tangled mess is sufficiently difficult that the way to go is to let > the user drag objects around to make the diagram readable and then save > the result. This is quite a good solution if no layouter is available or the effort of writing one, would be overkill. I think the approach you describe should do it.
Now, the big question is: What framework should I base my tool experiments on? Which framework is the current "state of the art" for developing a design environment dealing with database schemas? Using the Eclipse Modeling Framework (EMF) and start from scratch? Or are they any sophisticated frameworks available, which could reduce the development effort?
Regards, Max
Mishagam - 18 May 2007 21:19 GMT >> Well visualization. How about doing it like an Entity-Relationship model... >> thats at least one Visulaization that comes to my mind .. may be you [quoted text clipped - 27 lines] > Regards, > Max I believe I have seen Eclipse plugin doing just this - probably azzurri.clay. I played with it some time ago - you setup parameters like database connection, user, password, database used - and it produces picture or some structure with database schema.
send.me.all.email@googlemail.com - 20 May 2007 23:14 GMT > I believe I have seen Eclipse plugin doing just this - probably > azzurri.clay. I played with it some time ago - you setup parameters like > database connection, user, password, database used - and it produces > picture or some structure with database schema. Yes, thanks for the hint. Azzurri Clay is able to "reverse engineer" the schema of a concrete database and offers modeling in a visual manner. Like e.g. depicted in:
http://www.azzurri.jp/en/software/clay/images/clay_eclipse_1.png
So now I'm interested in what frameworks are available to start building my own visual modeling environment based on a concrete database schema. Just read the database schema, visualize it and let the user select some tables and perform some (nontrivial) operations on it. What's the best framework to start with to minimite the development effort? Any hints, ideas, approaches?
Regards, Max
Lew - 21 May 2007 04:59 GMT >> I believe I have seen Eclipse plugin doing just this - probably >> azzurri.clay. I played with it some time ago - you setup parameters like [quoted text clipped - 13 lines] > on it. What's the best framework to start with to minimite the > development effort? Any hints, ideas, approaches? Any chance you could set the followup on this thread to one newsgroup? I keep reading the same posts again and again.
Which newsgroup best represents the issues of your inquiry?
 Signature Lew
send.me.all.email@googlemail.com - 21 May 2007 21:55 GMT > Any chance you could set the followup on this thread to one newsgroup? I keep > reading the same posts again and again. Please correct me, if I'm wrong, but I always thought that the message I post should have one single unique ID if a proper crosspost is done (in contrast to multicopying, i.e. copying a post to several groups). If reading a certain message and this message becomes marked as read, a proper newsreader should recognize this message in other groups and show it correctly as already read. This should prevent reading a single message multiple times in differnt groups. But if things have changed, I'm willing to adjust my behaviour. :-)
> Which newsgroup best represents the issues of your inquiry? As it has something to do with databases and GUI development, I think crossposting to comp.lang.java.databases and comp.lang.java.gui should be enough.
Regards, Max
Lew - 22 May 2007 00:59 GMT >> Any chance you could set the followup on this thread to one newsgroup? I keep >> reading the same posts again and again. [quoted text clipped - 7 lines] > single message multiple times in differnt groups. But if things have > changed, I'm willing to adjust my behaviour. :-) You are partly right - you do have a single message "ID", but it shows up in every group you cross-post to. Since I read most of them, I keep seeing the same message in each group. Don't you? If not, then why cross-post?
I only asked because the thread has gone on for quite a while and I thought to minimize the repetition. The choice is entirely yours.
 Signature Lew
Lew - 22 May 2007 01:02 GMT >> Any chance you could set the followup on this thread to one newsgroup? I keep >> reading the same posts again and again. [quoted text clipped - 13 lines] > crossposting to comp.lang.java.databases and comp.lang.java.gui should > be enough. You are partly right - you do have a single message "ID", but it shows up in every group you cross-post to. Since I read most of them, I keep seeing the same message in each group.
I guess I don't have a "proper" newsreader by your lights, but it's always been good enough for me.
I only asked because the thread has gone on for a while and I thought to minimize the repetition. The choice is entirely yours.
 Signature Lew
Sualeh Fatehi - 21 May 2007 12:51 GMT Max,
- Reading a database schema (tables, fields, relationships) from SQL Server 2005?
SchemaCrawler is an open-source project that produces a rational the database metadata ojbect model. Take a look at http://www.devx.com/Java/Article/32443 SchemaCrawler can be downloaded from http://schemacrawler.sourceforge.net/
- Visualizing the DB schema?
SchemaCrawler comes with some dead-simple schema visualization examples, using JUNG. You can build more elaborate visualization using a good graphing library.
Sualeh.
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|