Author Topic: How to convert class objects into attribute objects?  (Read 5585 times)

BCGoitcwoodard

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
How to convert class objects into attribute objects?
« on: September 21, 2020, 09:44:20 pm »
I have a package with many DataElement objects.  I captured them during requirements gathering.  I believe that this is a stereotype of Class.  Now I would like to treat these objects as Attributes, e.g. columns in tables.
How can I convert these objects from “class instances” to “attribute instances” which could be moved into other classes like entities or tables?

I did a lot of csv imports to establish values of important tags on the DataElements.  I would not like to lose this work.
Alternatively, can I copy the tagged values of class objects like DataElements over to become tagged values of Attributes like database columns?
Thank you,
CCW

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13324
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to convert class objects into attribute objects?
« Reply #1 on: September 21, 2020, 09:47:01 pm »
There is no simple build-in way to do something like that.

But it would not be very difficult to create a script that does this.

Geert

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: How to convert class objects into attribute objects?
« Reply #2 on: September 21, 2020, 10:01:14 pm »
Hello,


As Geert says there's no automation to do this for you.

But representation-wise, I think the simplest way forward is to use your DataElement classes as types for attributes in your entity/table classes. (I'm assuming you won't be using EA's built-in data[base] modelling facility as it's generally not a good idea to add your own concepts to the built-in metamodels; your additions will at best be ignored and at worst break something.)

This way, the tagged values in your DataElement classes will be shown in the attributes' properties, and accessible from the attributes as "extended" tagged values. No need to copy anything, just reference it.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

BCGoitcwoodard

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: How to convert class objects into attribute objects?
« Reply #3 on: October 02, 2020, 03:46:42 am »
Thanks for replying- sorry for taking so long to get back into the thread.  But -  I want to be sure that I get this right.  Can you explain how I would use EA to "use your DataElement classes as types for attributes in your entity/table classes".  By "type", do you mean a user-defined data type for an attribute or something else ?  Can you explain a little more how "the tagged values in your DataElement classes will be shown in the attributes' properties, and accessible from the attributes as "extended" tagged values."?
Thank you.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1108
  • Karma: +28/-8
    • View Profile
Re: How to convert class objects into attribute objects?
« Reply #4 on: October 02, 2020, 05:40:14 pm »
I will give a more nuanced answer. It depends on how you do your data modelling. If you use an ERD model showing entity–attribute-relationship - please see https://en.wikipedia.org/wiki/Entity–relationship_model#/media/File:ER_Diagram_MMORPG.png, all you need to do is convert the tables and attributes to nodes, and apply the ERD Profile. After that you could apply to ERD to data modelling transformation to create a proper.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: How to convert class objects into attribute objects?
« Reply #5 on: October 03, 2020, 05:39:34 pm »
Hi again,


In order to use a DataElement class as an attribute type, first create the attribute and then in the Type dropdown, select Select Type... This brings up a dialog where you can browse to your class and select it. The DataElement is now the type of the attribute.

If you then select the attribute in the Features window and look at its properties (either in the Properties window or the Properties dialog), the tagged values tab ("Tagged Values" or "Tags") will show the tagged values from the DataElement.

This is in general. If you are working in ERD or a data[base] model, things are different.
ERD elements don't have UML attributes. You can add them (maybe not easily, but all elements in EA can have attributes) but then it's not an ERD model anymore so you're outside the intended way of working.
Similarly, while the columns in a data model table are implemented as attributes they've got a bunch of stuff added on top to make data modelling work, so again, going outside of that means something won't work as intended.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.