1.4.0 Build 436

visual editor for ORM frameworks

Pricing information Free download

How to create support for new ORM and MVC framework

This is summary article about internal ORM Designer mechanism in handling ORM frameworks

This article generally describes the necessary steps to implement a new ORM framework. Most of the topics are much more complex than stated in this article. Hence please consider this article to be a survey of all basic information. The chapters includes links to articles with more detailed instructions.

Ways how to create a support for any ORM framework

In ORM Designer the framework support consists of several parts:

  • Defining import and export for the ORM framework.
  • ORM properties and behaviors definition for particular objects.
  • Data types definition for ORM framework.
  • Optionally also definitions regular expressions for automatic files searching in project.

Data import and export for ORM framework

First part of ORM Designer support implementation can be realized in several ways. The chosen way depends on the fact, if the ORM framework supports base-class generating from some description file or not.

At first we will describe the implementation for the framework allowing to generate an orm classes from definition files. Next part describes implementation for frameworks without own generator and their definitions are currently manually written by their users.

Support for ORM frameworks with class generator

If you implement support for framework with class generator, the concrete solution depends on schema definition file structure. In the case that the framework already has his own format, it is necessary to implement XSLT templates for data transformation between the framework format and ORM Designer format. Further information about the technique of this data transformation are included in the article How ORM Designer performs import and export model schema files.

If ORM framework hasn't any description format but you want to implement it, there are two ways of this process. You can implement your own description format, or you can use directly the ORM Designer XML format. If you decide to implement your own format, it will be necessary to implement XSLT templates for transformation between this format and ORM Designer format. If your generator will works directly with ORM Designer data files, there won't be need to implement anything else and you will run your generator directly above the main ORM Designer file. More about ORM Designer format, its structure and usage you will find in article Structure of ORM Designer data file.

Support for ORM frameworks without the class generator

If your framework doesn't support class generator from a definition file and it won't neither in future, you can implement code generator directly into ORM Designer. For this purpose it is sufficient to create the templates, which on the current ORM Designer project generates the code. This code is automatically saved or it can be copied by user into his project. This solutions is from sight of implementation the simplest, but in some cases it doesn't offer all the features in contrast to previous alternatives, e.g. possibility of automatic and repetitive class definitions export, automatic import and other.

Support for ORM properties and behaviour

The next important part in ORM framework support implementation is object ORM properties. Each framework includes its own specific properties and options, e.g. behaviours set, various extended common properties, tables options and other.

For these options ORM Designer implement ORM properties. They allow to define an own attribute for any number of objects in ORM Designer (model, plugin, region, table, column, foreign-key, index, many to many relation and other) by XML configurations. The properties types can be of a simple types (string, decimal) as well as they can be of complex structure or dynamic lists and sets. For some data types it is possible to define in addition allowed values or automatic types, when ORM Designer offers available values (list of tables, columns, enum type). More information about dynamic properties settings for particular ORM framework is in the article How to configure new ORM properties and data types.

Configuration files for ORM framework

The last important part in ORM framework support implementation is setting of directory structure, recomanded file names and extensions, XSLT templates file paths, and more. Information how to correctly prepare the configuration file you can find in the article Structure of ORM Designer configuration file.

ORM Designer Api for developers

For simplyfiing the development of support for new ORM frameworks, ORM Designer suppors several command line params for . Thanks to that it is possible to run a batch for automatic import and export of one or more files and then compare the results by external files. This allows developers to write a unit-tests set to ensure quality and bug-free definitions. For more information about this api read the article "ORM Desiger API interface for developers".

Conclusion

If you decide to implement your framework support into ORM Designer, you are welcome to contact us with any questions. We will advise you with specific problems with implementations. If you are interested in, the batch with your ORM framework support will be desplayed at our website together with its logo and link to the article about your framework implementation. If your framework is wide-spread, it will be possible to agree on the implementation of your framework definitons directly into the ORM Designer installation.

As special offer we propose to each framework implementing its ORM a discount coupon for their users. By this coupon the framework can provide discount till 30% on ORM Designer purchase, or the bonus can be splitted up between framework developer and the users. More about our affiliate program you wil find in the article Affiliates.

List of all articles for developers


Author: Ludek Vodicka

ORM Designer on Twitter

Forum topics

ORM Designer forum: http://forum.orm-designer.com/

About ORM Designer

ORM Designer is a tool for modelling entity relationship diagrams (ERD). The biggest advantage is full support of any ORM framework which has its definitions stored in a markup language or other structured file.

Currently supported ORMs are PHP Doctrine, PHP Propel and CakePHP frameworks, but more will be added in close future.

Inventic s.r.o. - PayPal verified

Legal notice: The name CakePHP and the cake icon are trademarks of the Cake Software Foundation Inc., and used with permission. "symfony" is a trademark of Fabien Potencier.

Mouse Eye Tracking by PicNet Software Development Services

© 2009-2010 Inventic s.r.o. all rights reserved