For Programmers: Free Programming Magazines  


Home > Archive > Software Engineering > May 2006 > Going from ER Diagram to Code









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Going from ER Diagram to Code
Jay

2006-05-20, 10:01 pm

I am used to working wtih UML and then generating code on both UI and DB
side, but now I need to lead a team that is not used to OO work, but havy DB
background.

All the business models are done as ER Diagram. So my question is, is their
any easy tool that will generate C# code for Objects from a ER Diagram

Jay


Phlip

2006-05-21, 4:01 am

Jay wrote:

>I am used to working wtih UML and then generating code on both UI and DB
>side, but now I need to lead a team that is not used to OO work, but havy
>DB background.
>
> All the business models are done as ER Diagram. So my question is, is
> their any easy tool that will generate C# code for Objects from a ER
> Diagram


Would such a tool also generate the unit tests?

They are slightly more important, because they can prevent debugging.

--
Phlip
[url]http://c2.com/cgi/wiki?ZLand[/url] <-- NOT a blog!!!


H. S. Lahman

2006-05-21, 10:03 pm

Responding to Jay...

> I am used to working wtih UML and then generating code on both UI and DB
> side, but now I need to lead a team that is not used to OO work, but havy DB
> background.
>
> All the business models are done as ER Diagram. So my question is, is their
> any easy tool that will generate C# code for Objects from a ER Diagram


That depends on what sort of applications you are developing. Though an
UML Class Diagram and an ERD are superficially quite similar and are
both based on the relational data model, they tend to be constructed in
quite different ways because of the need to identify behavior in the
Class Diagram. The way relationships are managed in the OO context is
also quite different. How much difference depends upon the complexity
of the problem being solved.

For CRUD/USER applications where the primary problem being solved is
converting back and forth between the RDB and UI data views, there will
probably be no significant difference between the OO and ERD views --
which is why RAD IDEs work directly from the ERD view. But for
applications that solve significant problems for the customer there are
likely to be substantial differences. In that case you would need to
form an OO solution (albeit based on the ERD constraints) and then
convert that to code.

Note that the ERD does not describe dynamics in any way; it is a pure
data model. [Typically business models include a separate Process
Diagram. One reason why the OO solution is different is because those
diagrams are integrated rather than independent views.] So if the
problem requires more than USER/CRUD view conversions, you will not be
able to generate code from the ERD because the dynamic description is
missing. If there is also a Process Diagram, then you could manually
generate code from both, but I know of no tool that will automatically
generate full code from both. (The models need to play together better
for full code generators to work properly, which is why all commercial
full code generators work from UML OOA models.)

[BTW, if you are thinking in terms of just header files and body stubs
as "code generation", then doing so directly from an ERD would probably
be a really bad idea. Because of the differences in the way OO models
and ERDs are constructed, you will end up with an application structure
that is not suited to the dynamics that you will have to fill into the
body stubs.]


*************
There is nothing wrong with me that could
not be cured by a capful of Drano.

H. S. Lahman
hsl@pathfindermda.com
Pathfinder Solutions -- Put MDA to Work
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
Pathfinder is hiring:
http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com