Author Topic: Multitier modelling  (Read 2918 times)

terje

  • Guest
Multitier modelling
« on: December 21, 2005, 11:02:53 am »
I just want to discuss how multitier modelling can be done most effectively, and also if better support for this can be added to EA.

The problem arise when a logical concept is realized in multiple tiers or layers.  Assume for simplicity that you have a concept Car, and a realization of a database table Car, a business object Car and a presentation view Car.  All these Car's are realizations of the logical concept Car.  

Now, if you have a large model with perhaps from some ten's of concepts to some hundreds (our project now has some 200 concepts), and you have modelled in a lot of relations between these concepts.  Now - for any change to the concept model, you'll have to manually change all the other models, there is no clue in these models that they are connected together.  

Also, when you start out the project, you normally start with the concept model, then add the others as you start developing the system.  However, adding these others means you have to do a manual copy of these models.

Between the different Car's in a the different models I would use  trace relationship.  However, EA doesn't offer me any help to keep the models syncronized.  I've looked around for how others do this, and I don't find too much.  Neither am I quite sure how this is best modelled in UML.  

I'm also aware that many elements in such models doesn't translate 1:1, but may be much more complex - and automatic support will not help at all, however, for very many concepts in a rather large model you will infact have these 1:1 relationsship, and automation would really be a help.

I would appreciate comments and suggestions on this.  And could EA support some of this ?   Or, have I overlooked something (please say Yes - it would really makemy day :-) ?  



Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Multitier modelling
« Reply #1 on: December 21, 2005, 04:13:57 pm »
You certainly have overlooked something.

EA supports model transformations that do just this.  All you need to do is write the transformations between each type of concept and run the transformation each time the model changes.

It even supports things that aren't 1:1.  Basically it handles 1:0 (omission), 1:1 (copy or new representation), 1:* (multiple representations).  If you want to write an addin to assist your transformations by providing some more complex model traversal you can even do *:*.

Trace relationships can also be created between original elements and new elements automatically.

Do a search in EAs help and in this forum for more information.

terje

  • Guest
Re: Multitier modelling
« Reply #2 on: January 02, 2006, 08:18:25 am »
Thanks for the hint!  

I've tried to use some of this, and it is a starting point.  I've got some problems:  
1)  Trace information between the source model and the generated model is not visible for any of the default templates.  
2)  I've tried to include a tracing dependency following the patterns in the help files and the existing templates, but doesn't get any result from this.  The help doesn't give any more hints.  What would be the correct way to do this ?  

best regards
Terje

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Multitier modelling
« Reply #3 on: January 02, 2006, 04:05:42 pm »
When looking at the help file did you see the following page?

http://sparxsystems.com.au/EAUserGuide/index.html?transformingconnectors.htm

The last example on that page creates a tracing connector.  You'll need to use a structure like that, but make sure that the generated reference in the connector end matches the reference in the class definition.  http://sparxsystems.com.au/EAUserGuide/index.html?crossreferences2.htm gives more detail about the cross references you how to generate them.

terje

  • Guest
Re: Multitier modelling
« Reply #4 on: January 03, 2006, 05:18:33 am »
Yes, I have seen these files, and I've tried to follow the pattern.
Doesn't work, sorry.  And the documentation is far from complete  ???, so I'm afraid I've got to ask you a bit more:

The code in the example is as follows:
1:Dependency
2:{
3:%TRANSFORM_REFERENCE("SourceDependency",classGUID)%
stereotype="transformedFrom"
4:Source
5:{
6:  %TRANSFORM_REFERENCE("Class",classGUID)%
7:}
8:Target
9:{
10: GUID=%qt%%classGUID%%qt%
11:}
12:}

First:  Line 3:  The parameters to the macro call have to be generic.  Is that done by the namespace name(which I assume it is) or is the intention that this should be the specific namespace name?  If it is the specific name, that has to be queried for, since the routine is generic, so how do one do that?
Further, the classGUID command, which object does it get the classGUID of, the source object or the current new object (result of transformation)

Second: Line 6:  Same type of questions, but here it is clear that one should get the guid for the source object, but how do one find it?  I see from the doc that there are commands like connectorGUID, connectorSourceGUID and so on, but is there a classSourceGUID too?  Is there a list of all these possible commands somewhere?
Third:  Line 10:  The property GUID on the Target of a Connector, can't find that in the property sheet for that connector.  What is it?  

best regards
terje

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Multitier modelling
« Reply #5 on: January 03, 2006, 01:34:57 pm »
Hello Terje,

The parameters to the TRANSFORM_REFERENCE macro together define a unique reference.  Essentially from any one class (identified by the guid) has one or more (named) representations in one or more namespaces (generally the transformation name)

Because it is directly inside a connector context Line 3 defines the unique reference for that connector.

On the other handLine 6 is not defining a unique reference, it is looking it up.  It needs to use this method of looking up a class because the absolute reference to the source class isn't known because it hasn't been created yet.

The GUID on line 10 serves the same purpose as the TRANSFORM_REFERENCE on line 6.  It identifies a class to set as the target for the connector.  The difference in this case is because the source class is known in advance.  (It's the original class)

All the macros in these templates get information from the source model.

The complete list of substitution macros is found at http://sparxsystems.com.au/EAUserGuide/index.html?fieldsubstitutionmacros.htm, additionally, some of the function macros listed at http://sparxsystems.com.au/EAUserGuide/index.html?functionmacros.htm may be useful.

What exactly are you after in the help that isn't there?

terje

  • Guest
Re: Multitier modelling
« Reply #6 on: January 03, 2006, 05:10:49 pm »
Thanks for your help !

I appreciate your speedy help, and has managed to get it to work. However, it still wasn't quite clear how to do these things, I'll try to explain below, also for others to see.

I modified the DDL template to create a trace dependency back to the original class (shouldn't this really be a part of the default templates ?).

I started with the example code in my last posting, but it had to look like the code below (I've added line numbers for reference):
1: Dependency
2: {
3: %TRANSFORM_REFERENCE("Dependency trace",classGUID)%
stereotype="trace"
4: Source
5: {
6:   %TRANSFORM_REFERENCE("Table",classGUID,"DDL")%
7: }
8: Target
9: {
10:   GUID=%qt%%classGUID%%qt%
11: }
12: }

When working with this I also enabled the debug output from the Model Transformation->Transform Current Package dialog.

The change I had to do was in line 6, where I had to add the namespace of the target (generated) tables.  This is for me not clear from the documentation. I agree it's there, but it's so difficult to extract that meaning.

And in addition, I had to call this template (named Connector__TransformedFrom, which was made from pressing the Add New Custom Template button) from the class template, by adding a line

%Connector__TransformedFrom%

No example says this directly.  Also note a very ugly little thing:  The name has TWO underscores in it, and the name is automatically generated from the selections in the Add custom template dialog, and further you can't copy and paste the resulting name !  This also kept me stopped for some time.  

I used the debug output to see what was generated, and noticed nothing there until the two underscores were correct.  
Also noticed that if you call a template which doesn't exist, no error messages are generated.  This could be helpful in the debug output.

Also, the XRefs which was created, they don't seem to be visible anywhere in the EA.  I thought they would be visible from "See also" Cross Reference box, but nothing there.



About the documentation, it seems that the information is there, but it is hard to work from.  It seems like it is mostly a reference, with some small fragments of examples included.  
If you clearly seperated it into a reference and a tutorial guide, with the tutorial guide much more factual, it would be much more useful.  
Further, the documentation is often very terse, and it takes too much time to dig down to each detail.  The different terms used are also terse, and often poorly explained, making it quite hard to grasp what you mean.  

I really needed your help to get the understanding, but is still doubtful how fast I can be up to speed creating the transformations I need.  

I'll surely have to come back to you for more  ;)

terje

  • Guest
Re: Multitier modelling
« Reply #7 on: January 04, 2006, 02:49:09 am »
One little correction more:

Line 6 in the listing above:

It is enough writing
%TRANSFORM_REFERENCE("Table",classGUID)%

It selects the correct namespace for the target by default.  

Seems the major error was the double underscores  :-X