Skip to content

Feed aggregator

Reverse engineer a database

CapableObjects - Tue, 08/24/2010 - 22:31

Reverse engineering is what we call the process that takes a given database and turns it into a model driven “thing”.

image

 

You just need to give a valid connection string to it; in this case a use the MusicStoreDb from a MicrosoftSample:

image

You start by Analyzing the database:

image

And then you “Go!” – be aware of that this process will empty the package you started from and fill it with the stuff from the reverse engineer process:

image

 

Giving us this in the modlr tree:

image

And I will drag these classes out on a diagram to get this:

image

And that is enough information to run the model against the exact same database as we reversed it from:

image

Giving us a way to use the trusty AutoForms and EcoSpaceDebugger to look at the data and change it if we want:

image

In this particular database the RecordId, ArtistId and sofort are of type int in the database and are designed with “Is Identity==true” in SqlExpress. Also the “Identity Increment” is set in SqlExpress.

The Reverse algorithm gave us a model with int Attributes for the ID – we want ECO to be able to use that Key scheme instead of the standard ECO_ID – how is that done? Like this:

image 

The PrimaryKey setting we got from the reversing process and the PrimaryKeyMapper I set to ”AutoInc” - an Eco-supplied primary key mapper with that name that handles the normal AutoIncrease behavior of databases. (You can create your own named mappers in ECO for visualStudio).

And for the Attribute we must also say that it is DbAssigned; that forces ECO to omit setting the primary key on first save, and also forces ECO to read the saved row back from the database to get the actual assigned key (which we need to use as a foreign key in related objects) :

image

This is actually enough to be able to create new objects from the ecospace debugger and have them inserted in the database (or from code or wecpof or what have you). If you follow along in this brief and try to save a new Album you will notice 2 SQLServer exceptions – Both Genre and Artist foreign keys are marked NOT NULL in the DB – handle this by assigning an Artist and a Genre to the new Album with AutoForms drag and drop.

Database evolve

So when you have reached this far you may have the need for changing the model – just like any developer you might get an uncontrollable urge to make the model look more like reality from time to time.

To use the Model Evolve mechanism – that calculates what needs to be changed in the database by comparing a new and old db script – we have to allow ECO to write the (current)script to the database. If we do not do this ECO will not have any “old” script to compare the new script with that ECO derives from your current model.

In ECO for VisualStudio you can choose to store the script some other way by using the ORMappingProvider components in your EcoSpace – but in Gaffr/AppComplete you do not have any code so you really must allow us to store it in the database. Note that this is only if you want to use the Database Evolve mechanism.

To write the Script to the Database open up the prototyper once more by hitting “Run” :

image

And once we have done this one time operation, that is only necessary for reversed databases (since standard eco databases has these from the start), we can do some model changes:

image

And “Run” and “Evolve”:

image

Looking in the SQL Script tab in the dialog above we can see the expected script that ECO will send to the database:

BEGIN TRANSACTION;
/* Add column [Album].ReleaseDate */
ALTER TABLE [Album] ADD ReleaseDate DATETIME DEFAULT '19000101' NOT NULL;
COMMIT;

That wraps up this presentation of the Reverse (engineer) database function in ECO and Gaffr/AppComplete.

Categories: Companies

Industrialization of research tools: the ATL case

Software Modeling Blog - Tue, 08/24/2010 - 01:08
Research groups develop plenty of tools aimed at solving real industrial problems. Unfortunately, most of these tools remain as simple proof-of-concept tools that companies consider too risky to use due to their lack of proper user interface, documentation, completeness, usability, support, etc. -->

 

read more

Categories: Blogs

High Level Documentation: Layered or Package Diagrams?

Architexa - Working with Large Codebases - Mon, 08/23/2010 - 23:40
Layered diagrams seem to have become an integral part of documenting code well, but many developers don’t realize that they aren’t technically included in the UML spec. The UML standard provides a different sort of high level concept: the Package Diagram. It is often not clear when one should be used over the other, but [...]
Categories: Companies

Re: [UML Forum] UC model - how to model a background process run?

UML Forum Google Group - Mon, 08/23/2010 - 19:23
Hi there,
I have two comments:
- I agree with RJB's suggestion about 'sorting out' the design detail in
a different behavioural diagram. Much of the language in your post sounds
very design oriented and the use case diagram is the wrong place for that.
- I suggest that you will need to add some text to the model and the
Categories: Communities

Re: [UML Forum] uml question

UML Forum Google Group - Mon, 08/23/2010 - 19:23
Responding to hallak...
It is not only feasible, it is standard practice in most UML drawing
tools. However, it is usually done "under the hood" so that the linking
of state action to Activity Diagram is seamless in the tool's UI. The
tool can do this with a variety of mechanisms, like a hierarchical tree
Categories: Communities

Re: [UML Forum] UC model - how to model a background process run?

UML Forum Google Group - Mon, 08/23/2010 - 19:23
Responding to geoWRW...
I think you are reading too much into <<includes>>. Remember that use
cases are only in UML to provide traceability for requirements to the
model solution's elements. So all UML is doing is organizing the use
cases; it does not deal with the semantics of use case content at all.
Categories: Communities

uml question

UML Forum Google Group - Mon, 08/23/2010 - 19:23
hello everybody,
I have an Uml question, i tried to post it many times in vain, so i hope that it
is possible to get an answer even this way.
my question is about adding the internal activites inside a state in a State
diagram. my problem is that those activities are somehow complex that i want to
Categories: Communities

Re: UC model - how to model a background process run?

UML Forum Google Group - Mon, 08/23/2010 - 19:23
(1) Use NO connection! Hope this doesn't shock too much.

(2) Use <<include>> and sort out the synchronization using
asynchronous messages in a sequence diagram.

Hope this helps.

Categories: Communities

UC model - how to model a background process run?

UML Forum Google Group - Mon, 08/23/2010 - 19:23
Hello,

There are two use cases. One is a running process (a system function)
which performs some actions, then waits some time and performs the
same actions again. Let's say it runs all the time on and on. Let's
call it UC.1

There is also another Use Case which is an usual user performed
function - let's call it UC.2. UC.2 is a GUI function by means of

Categories: Communities

I can not use SUT sterotype for UML testing Profile on Eclipse

UML Forum Google Group - Mon, 08/23/2010 - 19:23
Hi,

I was building UML Testing Profile according to the UTP specification
from omg.org using Eclipse Galileo Modeling version.

I have created some stereotypes such as:
- TestComponent: extends UML::StructuredClassifier
- TestContext: extends UML::StructuredClassifier
- SUT: extends UML::Property

Categories: Communities

Re: [UML Forum] Understanding associative classes

UML Forum Google Group - Mon, 08/23/2010 - 13:21
Responding to belletti...
The association class is *required* for *:* associations because such
associations cannot be resolved with a simple referential attribute on
one side or the other. Essentially the association class is a
placeholder for a more complex underlying implementation. Thus quite
Categories: Communities

Understanding associative classes

UML Forum Google Group - Sun, 08/22/2010 - 05:49
Hello all.

I'm having some issue while applying the concept of associative class
on an exercise i have to complete.
So far i have always thought that an associative class is "only"
useful if the cardinality "multiplicity" between to classes is greater
then 1.
so for example:
"in a transports company there are several trucks that can only refill

Categories: Communities

Re: [UML Forum] UML is active, but the buzz is lost?

UML Forum Google Group - Sat, 08/21/2010 - 11:32
Responding to Cabot...
I think OMG shot themselves in the foot in their effort to make UML the
Mother of Modeling Languages. Prior to v2.0 one of the major knocks on
UML was that it was too big and complex because it tried to be a
superset notation for all OOA/D notations, many of which were somewhat
Categories: Communities

PyUML - UML to Python Roundtrip Tool

Software Modeling Blog - Sat, 08/21/2010 - 01:51

PyUML is an open source Eclipse plug-in offering round trip engineering betwee UML and Python.

PyUML is based on the PyDev (Python IDE for Eclipse) and Eclipse UML Tools plugins

-->

 

read more

Categories: Blogs

GRA2MOL - From grammars to modeling languages

Software Modeling Blog - Wed, 08/18/2010 - 04:18
GRA2MOL is a specially tailored DSL for extracting models from source code developed by Javier Luis Cánovas and Jesús García Molina from the Modelum group in Spain.

Most reverse engineering and software modernization processes require to extract some kind of models from the source code as a way to facilitate the understanding and/or manipulation of the legacy system. -->

 

read more

Categories: Blogs

Re: [UML Forum] Re: UML 2.x - Raising Events on Transition (State Machine / Effect)

UML Forum Google Group - Tue, 08/17/2010 - 14:47
Responding to Kirsten...
In an OO context the SM would implement an object and it would be the
objects that collaborated. So one would model that message sending in an
Interaction Diagram. One would describe the message generation and
relationship navigation either in an AAL or with analogous fundamental
Categories: Communities

RE: [UML Forum] UML is active, but the buzz is lost?

UML Forum Google Group - Tue, 08/17/2010 - 14:47
Jordi,
First, I use UML extensively, and have since UML 1.3.
Having said that, I think you are right that the UML is being quietly
adopted as the "lingua franca" of software and even perhaps systems (with or
without SysML) development. This survival has been in the face of myriad
domain specific languages that either casually imitated parts of the UML, or
Categories: Communities

Re: UML 2.x - Raising Events on Transition (State Machine / Effect)

UML Forum Google Group - Tue, 08/17/2010 - 14:47
Thanks for your sophisticated reply!

I am neither interested in OO development directly nor any code
generation (executable UML, etc.), but your explanations are still
very interesting.

As I said, I expected that there is no "send message to other SM"
notion as presented in many papers and tutorials, because they are all

Categories: Communities

UML is active, but the buzz is lost?

UML Forum Google Group - Tue, 08/17/2010 - 14:47
Software experts comment on this SD times article: [link]

that UML is still active but the buzz around it is now lost. My
opinion is that this is not necessarily a bad thing (more plus
comments here: [link]

Categories: Communities

Re: [UML Forum] UML 2.x - Raising Events on Transition (State Machine / Effect)

UML Forum Google Group - Tue, 08/17/2010 - 14:47
Responding to Kirsten...
If you are looking to use state machines in some other context than OO
development, you can stop reading. I suspect you are not interested in
OO development, though you might still find the comments on
implementation implications below interesting.
I'm afraid that is not the way interacting FSMs work, at least as far as
Categories: Communities