Entity Studio 0.1 Beta Readme
*** Generate Code !! Fast And How!!
By Anoop Madhusudanan
This project comes with GNU GENERAL PUBLIC LICENSE. See License.htm
. Provide credits whereever applicable.
The general design goal is to create
a project which can design entity relationship diagrams, to generate
database and program code out of it. ER diagrams can be imported from databases
and existing program code (classes). An Entity relationship diagram is something
like a relationship diagram you see in Microsoft Access. This project provides a
small environment to work with ER diagrams, an XML language and its DOM to
describe these ER diagrams, and a control that can be used to visually represent
these ER Diagrams.
Presently, it can
- Import ER diagrams from Access 97
database (using DAO)
- Export code to ASP (with relational
lookup combos for implementing relations).
I am working on a plugin interface. So,
by next release, you can write your own plugins to import and export
diagram/code from a variety of platforms.
The whole project group consists of three
- Importing entity relationship diagrams (like relationship
diagrams you see in Microsoft Access).
- Allow modification of each entity and relation in the diagram
- Save entity diagrams as XML schemas
- Allow Code generation from entity schemas
Entity Designer Schema Control
- Design entity relationship diagrams
- Dump this schema to an XML file
- Load this schema back from an XML file
Schema Model ActiveX Library
- It proives a Document Object Model for the Entity Relationship Definition
language (an XML language) to describe enity schemas.
- All projects that start with the name Plug
is a plugin project. To enable Entity Studio to load these projects, create
a file with a map extension - that is, if you need Entity Studio to
load PlugExportASP plugin, create a file named PlugExportASP.map
in the <entitystudiofolder>\Export folder. Otherwise,
you can put a registered dll file in the folder too (like
PlugExportASP.dll). But using a map file will help you to load plugins
before compiling them.
Follow the below steps to get a better picture.
- Open Schema.vbg in Visual Basic
- Select File->Import
From-> Access 97 Database. In the Open DAO dialog box, select
an Access 97 database. For example, open
the Nwind.mdb in your Visual Basic folder. The database will be
imported, and now you should see the Entity diagram of this database.
- (Important: You can import only Access 97 format databases. If
you are using MS Access 2000 or later, use Microsoft Access to open the
database you need to import, and select Tools->Database
Utilities->Convert Database ->To Prior Database Version in
import the converted database)
- Once you have your entity diagram, You can double click almost any field in an entity, to edit it's
properties in the schema. (Remember, we are still at beta stage, so some
- Click File->Export
To->Active Server Pages to bring up the Generate ASP Code
- Type the name and the
path. The path should be your IIS website root location (eg: c:\inetpub\wwwroot)
and the name can be any valid folder name (say nwind). Click OK
- After the project creation is complete, try it in your browser . eg:
http://localhost/nwind. Ofcourse, you need Internet Information
Server installed to interpret these
- Click File->Save Schema
(optional) if you need to save the schema to an XML file, for opening it
Important functions include
- LoadSchemaFromFile(Filename) -
Use LoadSchemaFromFile method to load a valid xml file to the schema
- DumpSchema() - Will return the
XML schema dump, so that you can save it to a file.
This Entity Relationship DOM will be used
in future by import and export plugins, to import and export ER information
from/to the system.
This DOM is now capable of
- Load a valid XML schema file
- Save itself to a file
If you are interested, carefully study the
IterateAll function in SchemaModelTest project (Make it the startup project and
then run). This way, you can get some light towards importing ER information to
the schema, and exporting it to the code.
You can customize the files in <entitystudiofolder>\Export\ASP
folder, to customize the style, appearence and control
code of the asp projects.
Important: You can find some
schemas in the Entity Studio Schemas folder. You can view them, but after
creating ASP code from them, they asp site won't work because the actual databases are
At a later stage, Entity Studio may
support generating databases from these schemas too :).
Now, you can use your own databases to create schemas and generate
code from them, as explained in the above quick start.
By An 'oop' Madhusudanan