Book a Demo

Author Topic: Forward engineering java and associations  (Read 3664 times)

craige

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Forward engineering java and associations
« on: September 14, 2005, 06:34:57 am »
I've looked in the documentation and I cannot find the answer to this.

Could anybody tell me how when I forward engineer a java class, have associations connected to the class converted to attributes with the name of the associated role and not the name of the class as given by the $LinkClass variable. Currently the default is set to m_$LinkClass and I don't know what else to change it to.

Thanks

Craige

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Forward engineering java and associations
« Reply #1 on: September 14, 2005, 03:42:18 pm »
I'm having a bit of trouble understanding exactly what you are after, but if the role is specified on the association end, then the default role name won't be used.

You can tell EA never to create role names by unchecking the option on the Generation page of the options dialog.

You can also modify what the default is on the Attribute/Operations page.

Simon

craige

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Forward engineering java and associations
« Reply #2 on: September 19, 2005, 02:13:23 am »
I'll try and clarify, it would be easier if I could post images. Consider the following  association.

[CLASS EPICSAction]------------------------------[CLASS PV]
                                1..* ActionPV

When I forward engineer class EPICS action, the attribute which is created to model the association is called m_PV (which is basically the name of the class at the other end of association link.  Ideally I would like the attribute to have the name ActionPV.

A second problem is that when the EPICSaction class is forward engineered into java, despite the fact that I am using a 1..* relation, the attribute which is created does not use a collection class despite the fact that I have set the collection class type to be HashTable.

I am using the latest version of EA.

Anybody any ideas?

Thanks in advance,

Craige

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Forward engineering java and associations
« Reply #3 on: September 19, 2005, 05:59:58 am »
Tried making ActionPV a role name [Source or Target] instead of it being an association name?
Verbal Use Cases aren't worth the paper they are written upon.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Forward engineering java and associations
« Reply #4 on: September 19, 2005, 03:32:05 pm »
It looks like you have the multiplicity and role on the wrong end of the connector.  Try swapping it to the other end so that it appears on the PV end of the association.

Simon