Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 425856

Summary: Add DRepresentation.getDescription()
Product: [Modeling] Sirius Reporter: Yvan Lussaud <yvan.lussaud>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: esteban.dugueperoux, pierre-charles.david
Version: 1.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Yvan Lussaud CLA 2014-01-16 05:14:52 EST
Add a method getDescription() on DRepresentation returning the RepresentationDescription. You might need to use generics in order to keep the contract of DDiagram, DTree, and DTable.
Comment 1 Esteban DUGUEPEROUX CLA 2014-01-20 05:33:40 EST
Indeed we could have something like that :

DRepresentation {


  T <T extends RepresentationDescription> getDescription();

}

or yet :

DRepresentation<T extends RepresentationDescription> {

  T getDescription();
}

with the implementations :

DDiagram<DiagramDescription> {

  DiagramDescription getDescription();
  
}
Comment 2 Yvan Lussaud CLA 2014-01-20 05:42:40 EST
I think the second proposition make more sens.
Comment 3 Pierre-Charles David CLA 2014-01-23 09:28:03 EST
I'm not sure about adding generics in our meta-model. Maybe it would work fine, maybe not. We have zero experience with it, I'm not sure this specific issue if worth taking the risk to create problems.

Yes, I understand this would be only a single case, but already the second proposition has impacts on all dialects, in description and representation classes.

A simple RepresentationDescription DRepresentation.getRepresentationDescription() would require client code to downcast, but at least it's a simple, localized change with no risk. It could be a derived reference implemented in each dialect by the existing getDescription() references.
Comment 4 Pierre-Charles David CLA 2021-03-21 11:20:44 EDT
Should be fixed by using: new DRepresentationQuery(drep).getRepresentationDescriptor().getDescription().

It's not exactly what was requested as it it not directly on DRepresentation, but it seems close enough.