Author Topic: About association  (Read 3988 times)

thomaskilian

  • Guest
Re: About association
« Reply #15 on: September 01, 2005, 02:29:20 am »
Quote
...
NOTE: This problem is NOT unique to EA.  I believe it to be a general fallacy that round-trip-engineering from a model to pure code is possible...

The MODEL rules!

I just remember the way this is done in Rose. They put a lot of UIDs in the generated code, hoping to find a grip when climbing back. Unfortunately all this UID comments make the code hard to read and maintain.

Are you going to make a product of your emitter, Paolo?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6255
  • Karma: +104/-89
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: About association
« Reply #16 on: September 01, 2005, 07:42:59 am »
Quote
The MODEL rules!

I just remember the way this is done in Rose. They put a lot of UIDs in the generated code, hoping to find a grip when climbing back. Unfortunately all this UID comments make the code hard to read and maintain.

Are you going to make a product of your emitter, Paolo?
The model RULES!

This evening, I started to create the portion of my process that actually emits code from the emitted interface.

An hour later, I was generating a C# artifact containing the manifestation of two classes in the model.  
Code: [Select]

//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a tool.
//     Runtime Version: 1.1.4322.2032
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

namespace Artifact1 {
   
   
   public class Class5 {
       
       private Enumeration Mary;
   }
   
   public class Class4 {
       
       private Character Fred;
       
       private DateOnly Bill;
       
       private void Mary;
       
       private void cxvzxcvzxcvx2() {
       }
   }
}


Unfortunately it's not correct, since Class4 is supposed to be nested inside Class5 but what do you expect for a (literally) first attempt!  This is the first output after the first clean compile.

Rapturously!
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

thomaskilian

  • Guest
Re: About association
« Reply #17 on: September 01, 2005, 07:51:58 am »
Quote
... Runtime Version: 1.1.4322.2032...

At what frequency do you emit new code? ;D

Good luck! Looks like a lot of fun waiting for you :)

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: About association
« Reply #18 on: September 01, 2005, 12:16:56 pm »
Paolo;
I'm not familiar with your project.  What is the input to your process?
Verbal Use Cases aren't worth the paper they are written upon.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6255
  • Karma: +104/-89
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: About association
« Reply #19 on: September 01, 2005, 01:28:42 pm »
Quote
At what frequency do you emit new code? ;D

Good luck! Looks like a lot of fun waiting for you :)
Maybe as often as Microsoft?  ;D

Well, I went to bed a happy chappy...

Woke up early, a quick Google... 5 minutes of refactoring and:

Code: [Select]
//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a tool.
//     Runtime Version: 1.1.4322.2032
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

namespace Artifact1 {
   
   
   public class Class5 {
       
       private Enumeration Mary;
       
       public class Class4 {
           
           private Character Fred;
           
           private DateOnly Bill;
           
           private void Mary;
           
           private @void cxvzxcvzxcvx2() {
           }
       }
   }
}

8)




But wait... There's more!  8)  8)

A quick cut and paste, call a different provider and:

Code: [Select]
'------------------------------------------------------------------------------
' <autogenerated>
'     This code was generated by a tool.
'     Runtime Version: 1.1.4322.2032
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </autogenerated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On


Namespace Artifact1
   
   Public Class Class5
       
       Private Mary As Enumeration
       
       Public Class Class4
           
           Private Fred As Character
           
           Private Bill As DateOnly
           
           Private Mary As System.Void
           
           Private Function cxvzxcvzxcvx2() As void
           End Function
       End Class
   End Class
End Namespace


35 secs to add a new output language!

How cool is that?   8) 8) 8)

Now to actually make things work....

Uber Wrappt!
Paolo
« Last Edit: September 01, 2005, 01:30:03 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6255
  • Karma: +104/-89
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: About association
« Reply #20 on: September 01, 2005, 02:07:54 pm »
Quote
Paolo;
I'm not familiar with your project.  What is the input to your process?
Hi Jim,

The output I produced above was the untransformed output from an EA Model via the UMLPlus Interface I've developed.  It's not the final product, but an other proof of concept to the final goal:  To produce artifacts (in various languages and in various formats) from a single source with as high a level of abstraction as possible.

One of the hardest things to produce would be source code.  So, in line with Agile approaches, that's the one I did first.

I have developed a set of modelling technologies that, I believe, allow me to create quite reasonable models of the world - which in Model Driven Architecture (MDA) terms are closest to Computationally Independent Models (CIMs).

We MDAers assert (and so far so good) we can follow the MDA chain and generate Platform Specific Models (like the output above).

As I mentioned I decided I couldn't wait for EA to catch up, and to be fair, I wanted to generate much more than code - a verbalisation of the model in English narrative, test instructions, other documentary artifacts which EA couldn't provide.  

Also, since my modelling technology is richer than just code generation, I needed to impart this metadata to the generators.  So I split the process in two:

  • Modeling  - using a suitable Modeling tool (EA), emitting the model onto a defined two way interface (in this case in XML - which allowed me to create a formal XSD which checks that the XML interface output is structurally and syntactically valid)

  • Generation - using a suitable set of generation technologies (CodeSmith + CodeDOM).

    This particular project started when I moved my CIM from Rose to EA.  I needed the verbaliser I had created in Rose to allow non-modelling Domain Experts to validate the business rules encoded in the CIM by reading the English narrative the verbaliser produces.

    Rather than embed the verbaliser as an Add-In (which I will do down stream) I decided it would be better to generate it off-line via the interface.  I then realised I could generate all sorts of stuff off the same interface if I made it a bit richer...

    Some colleagues couldn't get their heads around the concept so they challenged me to generate some code...

    Thus here we are...

    Now, since we are in a Supply chain, from CIM to PSM, the source model I'm currently outputting from is closer to a PSM than anything else.  When I sort out how to get a PSM across the UMLPlus interface, I'll look at getting a Platform Independent Model (PIM) across the same interface and performing the PIM to PSM transformation on the generation side of the interface.

    Since MDAers assert that you can take a CIM an via a repeated set of transforms create PIMs and PSMs, I should eventually be able to take a CIM (and transformation rules) across the UMLPlus interface and generate PSMs on the downstream side...

    Here's hoping...

    Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: About association
« Reply #21 on: September 01, 2005, 02:56:34 pm »
Very impressive!  The world needs something like that.

I'm getting the feeling that EA has matured to the point where the developers need to spend so much time responding to issues raised by their clients that they don't have much time to move their product along its migration path.  Perhaps we can get them to Open Source the product like Sun has with theirs.  ;D

I would enjoy being a test user for you on this...I'm well known for breaking software  ;D
Verbal Use Cases aren't worth the paper they are written upon.