Author Topic: Convert class to instance (and keep the class) [Have Cake and Eat It]  (Read 5092 times)

YogaMatt

  • EA User
  • **
  • Posts: 111
  • Karma: +8/-0
    • View Profile
Modelling has proceeded with relationships being drawn between classes.
We want instantiate the classes into objects such that:
  • the classes to become architectural building blocks as defined by TOGAF: the classes should not retain the relationships - they are building blocks and should be freely available to instantiate within baseline and target architectures.
  • the instances retain the relationships that existed between the classes, and the instances appear on the diagrams that the classes had appeared on
The manual effort is onerous. Does this require scripting or is there a pre-canned solution in EA?
Thank you.
 

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Scripting seems to be the option.
A script that scans through all elements in a diagram and converts its type to 'Object' (thereby retaining all its connectors),
Create a 'Class' object into a set package, using the name and other metadata from the original object
Set the new Class ID / GUID as Classifier to the original Object (previously class) to make sure it knows its Classifer.


YogaMatt

  • EA User
  • **
  • Posts: 111
  • Karma: +8/-0
    • View Profile
Scripting seems to be the option.
A script that scans through all elements in a diagram and converts its type to 'Object' (thereby retaining all its connectors),
Create a 'Class' object into a set package, using the name and other metadata from the original object
Set the new Class ID / GUID as Classifier to the original Object (previously class) to make sure it knows its Classifer.
Good logic - which ought to retain the diagrammatic representations. Thanks.