UML to SQL DDL generation

773 views
Skip to first unread message

Jordi Cabot

unread,
Dec 13, 2009, 5:25:09 PM12/13/09
to UML Forum
I'd like to invite you to test my online code-generation service to
transform UML class diagrams into database schemas. The service
creates SQL DDL scripts for all major database vendors: Oracle, MySQL,
Postgresql, DB2, SQLServer, Firebird, Interbase.

Visit the service page (http://modeling-languages.com/content/uml2db-
full-code-generation-sql-scripts-databases) for more information on
why and how use the service, what elements are supported/generated,
examples,...

Do not hesitate to contact me for further information/feedback.

Regards

Jordi Cabot

--
Software modeling languages portal: http://modeling-languages.com
Software modeling blog: http://modeling-languages.com/blog
Personal Home page: http://jordicabot.com

Class Act ;-)

unread,
Dec 14, 2009, 2:28:20 PM12/14/09
to UML Forum
Cool: great idea, great implementation.
Prompts a question for those who have a dual interest in SQL and UML:
is there a profile out there? Any good sample models?
All the best,
Class

Jordi Cabot

unread,
Dec 16, 2009, 3:56:02 AM12/16/09
to UML Forum
Hi,

Thanks for your nice comments. Hope you decide to give it a try!

Regarding your comments about the profile:

Some CASE tools offer you a profile to design relational schemas. For
instance, MagicDraw expects designers to first create a normal UML
class diagram and then to refine and annotate this class diagram with
its relational profile (including stereotypes pK, FK, table,...)
before doing the database generation. See a small example here:
http://jordicabot.com/research/OCLSurvey/index.html (the text, a
survey of OCL tools, is irrelevant for this discussion just take a
look at Figures 1 and 4, where figure 4 is the refinement for database
schema generation of Figure 1). In MDA terms, Fig.1 would be a PIM
model and Fig. 4 the PSM one

What my tool does is to free the designer from the task of creating
the PSM model (the one annotated with the database profile) before
performing the code-generation. My view is that all changes between
Fig. 1 and Fig. 4 can be automated using the well-known UML-to-
database transformation techniques so my tool automatically (and
internally) perform these transformation on the input model,
simplifying the generation process. True, designers may lose a little
bit of flexibility but they gain a lot in efficiency and the generated
code will be in the vast majority of cases exactly what they were
expecting.

Regarding sample models, if you mean input UML models and their
corresponding SQL script, I've to provide more examples in the service
web page (http://modeling-languages.com/content/uml2db-full-code-
generation-sql-scripts-databases). Let me know if you are interested
in any specifically kind of examples. If you were referring to sample
models with the profile I'm afraid I don't have examples, apart from
the one pointed above.

Jordi

Petraq Papajorgji

unread,
Dec 17, 2009, 8:47:01 AM12/17/09
to umlf...@googlegroups.com
I looked at your website and have a comment: you state that your tool generates most fo the code not only class skeletons. what do you mean by this? what can do you about behavior?

thank you,

petraq

--

You received this message because you are subscribed to the Google Groups "UML Forum" group.
To post to this group, send email to umlf...@googlegroups.com.
To unsubscribe from this group, send email to umlforum+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/umlforum?hl=en.





--
Petraq Papajorgji, PhD
Associate Research Scientist
Center for Applied Optimization
Adjunct Associate Professor
Industrial & Systems Engineering dept.
University of Florida
Gainesville Fl 32611

Jordi Cabot

unread,
Dec 17, 2009, 1:29:18 PM12/17/09
to UML Forum
Hi Petraq,

My point is that if you give to a developer a domain model (i.e. a UML
class diagram) with no indication of the behaviour the system must
provide, the developer will be smart enough to figure out by him/
herself a huge part of the expected behaviour. In particular, if a
class diagram contains a class "A", common sense will tell the
developer that he/she needs to create a form/operation to create
objects of type A, another to update existing objects of type A,
another to delete objects, to list them,... Basically, the idea is
that all typical required CRUD operations can be easily deduced just
by looking at the class diagram, we do not need to explicitly model
this basic behaviour.

My service will have embedded this "common sense" and use it to
generate the web pages for all CRUD applications (similar to what
other MVC web frameworks do but starting at a higher abstraction
level). Of course, more complex behaviours cannot be deduced from the
class diagram and need to be manually programmed by the developers
afterwards so I'm not generating 100% of the code but around 80% of it
(according to some research experiments we have done, for the research
papers follow the URL below, check my research web page http://jordicabot.com
or just send me an email).

This is what I call the pareto's principle for MDD (http://modeling-
languages.com/blog/content/pareto-principle-applied-mdd), with 20% of
the modeling effort we can generate 80% of the system.

To me this is good enough for many situations. Only in particular
scenarios, modeling the 100% of the system to automatically generate
100% of the code will pay off. In an ideal world that would be our
goal but in the real one the effort of modeling 100% of the system is
too high for many data-intensive applications.

Jordi


On Dec 17, 8:47 am, Petraq Papajorgji <pet...@gmail.com> wrote:
> I looked at your website and have a comment: you state that your tool
> generates most fo the code not only class skeletons. what do you mean by
> this? what can do you about behavior?
>
> thank you,
>
> petraq
>
>
>
> On Wed, Dec 16, 2009 at 3:56 AM, Jordi Cabot <jca...@acm.org> wrote:
> > Hi,
>
> > Thanks for your nice comments. Hope you decide to give it a try!
>
> > Regarding your comments about the profile:
>
> > Some CASE tools offer you a profile to design relational schemas. For
> > instance, MagicDraw expects designers to first create a normal UML
> > class diagram and then to refine and annotate this class diagram with
> > its relational profile (including stereotypes pK, FK, table,...)
> > before doing the database generation. See a small example here:

> >http://jordicabot.com/research/OCLSurvey/index.html(the text, a


> > survey of OCL tools, is irrelevant for this discussion just take a
> > look at Figures 1 and 4, where figure 4 is the refinement for database
> > schema generation of Figure 1). In MDA terms, Fig.1 would be a PIM
> > model and Fig. 4 the PSM one
>
> > What my tool does is to free the designer from the task of creating
> > the PSM model (the one annotated with the database profile) before
> > performing the code-generation. My view is that all changes between
> > Fig. 1 and Fig. 4 can be automated using the well-known UML-to-
> > database transformation techniques so my tool automatically (and
> > internally) perform these transformation on the input model,
> > simplifying the generation process. True, designers may lose a little
> > bit of flexibility but they gain a lot in efficiency and the generated
> > code will be in the vast majority of cases exactly what they were
> > expecting.
>
> > Regarding sample models, if you mean input UML models and their
> > corresponding SQL script, I've to provide more examples in the service
> > web page (http://modeling-languages.com/content/uml2db-full-code-

> > generation-sql-scripts-databases<http://modeling-languages.com/content/uml2db-full-code-%0Ageneration-...>).

> > umlforum+u...@googlegroups.com<umlforum%2Bunsu...@googlegroups.com>

Petraq Papajorgji

unread,
Dec 18, 2009, 9:28:28 AM12/18/09
to umlf...@googlegroups.com
Hi Jordi,

Thank you very much for your comments. I would like to know if you think/use or plan to use any languages to express object behavior. I see the value of your work especially when one works objects that are to be persistent. But in general, objects that are not to be persistent the main problem is expressing the behavior of the object in a general way that is independent of any implementation technology.

thanks again,

Petraq

To unsubscribe from this group, send email to umlforum+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/umlforum?hl=en.


Jordi Cabot

unread,
Dec 19, 2009, 4:35:30 PM12/19/09
to UML Forum

On Dec 18, 9:28 am, Petraq Papajorgji <pet...@gmail.com> wrote:
> I see the value of
> your work especially when one works objects that are to be persistent.

Yes, this is the domain I'm focusing on: data-intensive applications

>But
> in general, objects that are not to be persistent the main problem is
> expressing the behavior of the object in a general way that is independent
> of any implementation technology.

How to express the behaviour is not an easy question and depends, for
instance, on the level of detail you want to express. In order to
generate 100% of the application code, behaviour has to be expressed
very precisely and without ambiguities. For that, UML has the Action
Language (to put it simply, kind of a pseudocode). This Action
language will be the basis of the upcoming UML Executable standard (a
subset of the current UML precise enough to be executable)

Jordi

--
Software modeling languages portal: http://modeling-languages.com
Software modeling blog: http://modeling-languages.com/blog
Personal Home page: http://jordicabot.com

> On Thu, Dec 17, 2009 at 1:29 PM, Jordi Cabot <jca...@acm.org> wrote:

> > > >http://jordicabot.com/research/OCLSurvey/index.html(the<http://jordicabot.com/research/OCLSurvey/index.html%28the>text, a

> > <umlforum%2Bunsu...@googlegroups.com<umlforum%252Buns...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages