Author Topic: Associating GUI controls with data model columns  (Read 3886 times)

kepNCI

  • EA User
  • **
  • Posts: 127
  • Karma: +1/-0
    • View Profile
Associating GUI controls with data model columns
« on: April 04, 2013, 06:41:02 am »
Would like to relate an application screen field with its underlying database column(s) and then create a create a report that, given a database column, displays all application's screen/fields that are associated.  I am thinking this cannot be done, but wanted to see if anyone has any solutions. This is what I tried...

- I have the screen defined using interface models/GUI Elements.
- I have the database defined by creating a data model via "Import DB schema via ODBC..." function.
- It is the association of the GUI control with the table/column that I am having trouble.

I tried using the "Link to Element Feature"...
On my user interface diagram, I dragged a link to the database table and then created an association (realization) between the GUI Control and the database table. I then used the "Link to Element Feature" to associate the link to the actual table column (attribute). This is great for a visual representation on the diagram, but as the EA documentation clearly states, the actual association is still between the GUI control and the table (not the column). Thus the data model RTF template now includes all of the GUI associations under the "Relationships" grid for the table. This would be OK, in fact, desired, if the report could display the "linked" column (attribute) in addition to the table, but I do not see a way to do this. Assuming I cannot use the data model template to display the GUI to Table column association, I  would like to filter out the GUI control association so that the Relationships grid only shows schema table associations. I cannot see how to do that either.  So I am stuck.

For me the perfect scenario would be that the data model RTF template could still be used but instead of one Relationship grid, there would be two (so that one can define a different format depending upon the type of link). One would basically be the one that currently exist, that is, it displays the relationships between the tables (this would require some type of filter that would only include class associations whose stereotype = table). The other grid would show relationships between the table's columns and any associated GUI Controls (this would require some type of filter that would only include associations where one side is a GUI Control, plus the capability to display the actual associated table columns).

As it is now, not sure if it is worth providing just a visual association using the "Link to Element Feature" between the GUI element and the table column, if I cannot report on it or create queries to trace the use of a table/column within the user interface.  

Any ideas?

Karl

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13065
  • Karma: +544/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Associating GUI controls with data model colum
« Reply #1 on: April 04, 2013, 05:57:41 pm »
Karl,

There must be a way to use the linked attribute in your RTF template, but it might be rather difficult.
Have you tried it with eaDocx. I'm not sure, but expect that tool to be able to handle those.

Geert

kepNCI

  • EA User
  • **
  • Posts: 127
  • Karma: +1/-0
    • View Profile
Re: Associating GUI controls with data model colum
« Reply #2 on: April 05, 2013, 12:54:14 am »
Thanks Geert

No, I have not tried eaDocx.

I did come up with an easy workaround, at least for reporting in the data model report. Taking a clue from EA's table association connections, I use the connection's property name field. When EA imports a schema from ODBC, it places the associating column names as the name of the connection. The data model template displays the connection name field under the Relationship grid's first column (named "Column"), for example "(FKeyID = PKeyID)". For my linked attribute connection, I enter the linked column (attribute) name as the name of the connection, for example: "(attriburename)".  Without changing the data model template, I now see both the table column (attribute) and the GUI Control's element name.
Also, in my version of the data model template, in addition to the element name of the source and target, I display the parent package name. That way, by naming the package the same name as the application screen name, I now have reference to the screen and control in the report.  

I think this well work well for the report.  

Karl

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Associating GUI controls with data model colum
« Reply #3 on: April 05, 2013, 04:24:36 pm »
In the RTF template editor -  in the Section view -  under the section: Element | Connector | Source  - there is an option for: Linked Feature.

Try adding this Section then use the fields associated with it.

kepNCI

  • EA User
  • **
  • Posts: 127
  • Karma: +1/-0
    • View Profile
Re: Associating GUI controls with data model colum
« Reply #4 on: April 06, 2013, 12:39:25 am »
Yes, using the Link Feature.name works in the RTF report.  THANKS. Not sure why I did not try that.  

On the other hand, there is an advantage of naming the connection similar to how table associations are named (see previous post reply).  The Relationship grid in the template appears to be sorted by the connection name (displayed under "Columns"). By naming my linked element connections, I get a better grouping of the elements in the report.