Book a Demo

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Christhonie

Pages: [1]
1
General Board / Re: to PIM or not to PIM
« on: April 10, 2010, 01:53:34 am »
Hi Davide,

We do multiple transforms from our PIMs to generate business objects and DTOs (some applying our own frameworks, wrapping classes in other classes, (de)marshaling code to/from the classes), XSDs and WSDLs.  

The key is to develop your own "flavour" of a PIM that can address the needs of all target platforms/outputs.  So you are on the right track to think of an OO PIM, as that will be rich enough in meta data to generate both target PSMs.  

I suggest that you do not contaminate your PIM with PSM specific constructs, i.e. rather than using "struct" stereotypes use something like "message" to denote message classes , generating classes in C++/C#/Java and struct in C.  Your PIM should, as the name states, be platform independent.  We also make extensive use of tags within the PIM to add the required meta data to guide the PSM transform in performing their functions.

That said, it is a mission to develop these transforms.  We have invested months in writing our own transforms.  And the template framework in EA is the most pathetic design I have seen in my life; i.e. try to do an arithmetic operation on values, loops, etc..  I suggest you make use of the Automation Interface to add functionality.  We use Win32 code as C# add-ins cannot run on Linux.  We have even included a caching layer in the add-in to speed up access to elements and connectors, as EA calls the DB for every a single property is being accessed.  We now get an over 2000% speed improvement.

Hope this helps.
Chris

2
General Board / Re: Split text in template - Calculation not possi
« on: August 22, 2009, 11:03:23 am »
Thanks Simon, that will do the trick for now.

I am saddened to find that you have developed your own templating (scripting) language from scratch, having numerous limitations in my eyes, when it is so easy to take an existing scripting implementation, like VBScript, Groovy, etc, and wrap it with your domain specific language.  Not only do you use a familiar syntax, but also gain from existing functionality and tools like design-time syntax highlighting, code completion, debugging tools, etc. that come with most interpreter implementations.  In general: Do not re-invent the wheel.

That said, I can complement you on an otherwise feature rich and stable product.  We are proud users of your product.  Keep up the good work.

3
General Board / Split text in template - Calculation not possible
« on: August 20, 2009, 10:58:29 pm »
Hi all,

How do I go about doing basic calculations (increment a variable in this case) in a code or transformation template.  I need to separate a string into 2 parts around a literal as such;

I can find the left side by;
$position=%FIND($parameter1, ".")%
$left=%LEFT($parameter1,$position)%

But I now need the right part and need to add a simple one to the index, like;
$right=%MID($parameter1,$position+1)%

I can not get position to increment.  How do I get this to work?  Surely this simplistic case should be catered for?

4
Hi Dan,

If you have not found answers yet, or if someone else might have the same questions, here are some solutions to your problems;

So far we have not found a way not to overwrite values in subsequent transforms.  Only when you do not set a field in a transform will it remain untouched.

The camel case and replacement can be achieved by modifying the transformation templates.  I.e. To CamelCase the Class name you might want to do this in the Class template:

Code: [Select]
Class
{
  name=%qt%%CONVERT_NAME(className,"pascal case", "Camel Case")%%qt%
  %TRANSFORM_CURRENT("name")%
}

To map PIM to XSD types you can define it under Settings->Code Datatypes.  This require the use of the %CONVERT_TYPE()% function macro within the transformation templates.  We have implemented a more elaborate scheme where we defined our own "Primitive Data Types" and mapped those, using specific connectors, to XSD primitive types, imported from the XSD XMI file found on the Sparx website and using a special add-in which is called from the transform template.  We have reasons for doing it this way, which is out of scope here.

Chris

5
Hi,

How can I access inherited tag values when writing transforms or when generating code?

I have ClassA with attribute Att1 of type ClassB.  The tags of both the attribute and those defined for ClassB are visible in the Tagged Values panel (under sections "Att1 (Attribute) and "from ClassB"), but the %attTag:"xx"% macro is only able to access those explicitly defined in the current attribute.

The EA User Guide (at http://www.sparxsystems.com/uml_tool_guide/what_is_uml_modeling/advancedtagmanagement.html) states that users can "View Tagged Values inherited from parent Classes or realized interfaces or applied stereotypes", override them and delete them, but what is the use if not accessible using the macros.  Am I missing something?

Any help would be appreciated.

Regard,
Chris

Pages: [1]