0
有什麼不對這種模式:這個簡單的EMF模型有什麼問題?
/** @model abstract="true" */
public interface ContainedObject {
/** @model */
public Container getContainer();
}
/** @model abstract="true" */
public interface Container extends ContainedObject { }
/* @model */
public interface Category extends Container {
/** @model containment="true" opposite="container" */
public List<Category> getCategories();
/** @model containment="true" opposite="container" */
public List<Variable> getVariables();
}
/** @model */
public interface Variable extends ContainedObject { }
我想所包含的對象和它的容器之間的雙向性。 對於上述的java我收到以下錯誤消息時,我嘗試創建.genmodel:
the opposite 'container' already has attribute 'categories' of 'Category'
as its opposite
有什麼不對這種模式?