EMF Modeling question: container and containment

453 views Asked by At

I'm familiar with Entity Framework and code-first design in Visual Studio, but I'm getting my feet wet with Eclipse. That said, I'm trying to understand how some of the properties for eReference attributes translate in ecore models. Specifically, when I read about container and containment, I'm finding myself lost. Are these fields somehow translatable into either SQL Foreign Key relationships or entity model object relationships? I can understand both of those pretty well. Specifically, in either SQL or EF terms, what does it mean when container=true, what does it mean when containment=true.

1

There are 1 answers

2
Banoffee On

I am not familiar with SQL or EF, but from what I am reading, Foreign Key is more like EReference (and other fields are EAttribute, with "primary key" being an EAttribute with isID set to true).

Containment in Ecore is a particular case of EReference. The key part is that an EObject can only be contained by one other EObject. I think the best would be for you to just try it out on a simple Ecore metamodel!