Author Topic: Modeling the return of an object reference  (Read 4205 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6267
  • Karma: +104/-89
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Modeling the return of an object reference
« Reply #30 on: May 26, 2006, 08:19:59 am »
Quote
Interesting syntax.  I've been away from the code too long; what language is that?  I thought a PIM was still language independent.
 
This syntax seems to imply sufficient rigour to support an automated CIM2PIM transformation, where the MDA folks say a manual transformation is the only possible way to go.

Further, KP's notation is really Paolo's notation which Paolo now seems somehow concerned about.  ???

And what happened to the proposition of using Generics to achieve type independence (assuming polymorphism is inappropriate)?  :-/   Could it be that Paolo's notation is a form of Generics?

I'm confused, but that's how I learn  ;D
Sorry for spreading confusion...  The point about my original syntax is that very very few languages are able to support polymorphism by return type (only) and then in a very restricted fashion.

As to the TypeOf(Individual) construct I was trying to show that if you tried to use polymorphism by return type, you'd have to transform it to named specific method somewhere on the transform chain in order to use it in the PSM.  Since in the expression:

Individual = fillPosition(Position), Individual is actually a variable, you'd need to get it's type (such as Person - or Individual the type) so as to transform it to:
Individual = fillPosition_Person(Position) or fillPosition_Individual(Position).

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: Modeling the return of an object reference
« Reply #31 on: May 26, 2006, 09:15:33 am »
Thanks, I understand now.
Verbal Use Cases aren't worth the paper they are written upon.

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Modeling the return of an object reference
« Reply #32 on: May 27, 2006, 05:42:59 am »
Thinkng about:
Individual = fillPosition_TypeOf(Individual)(Position)
Would EA's transformation engine be powerful enough to work with this syntax?  I assume I'd have to write a rule of some sort for this, but would the engine allow such a rule and deal with it effectively?
Verbal Use Cases aren't worth the paper they are written upon.

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6453
  • Karma: +55/-6
    • View Profile
Re: Modeling the return of an object reference
« Reply #33 on: May 28, 2006, 03:15:15 pm »
The syntax used there looks very much like VB.Net generics.  Individual = fillPosition(Of Individual)(Position)

The only difficulty for doing this in an EA transformation is finding out that you need to do it.  (There are two or more methods differing only on return type.)

A huge variety of automated transformations are theoretically possible provided the source model is modeled in a consistent manner.
Simon

support@sparxsystems.com