Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MDT (Model Development Tools) » Creating objects with multi-valued children
Creating objects with multi-valued children [message #597730] Tue, 01 September 2009 09:09
Doug Bercot is currently offline Doug Bercot
Messages: 5
Registered: July 2009
Junior Member
If I were to create a simple object that has a containment association
with an N..N value (as shown in the "simple" model below), is there a
proper place in which I can modify the generated code such that the
contained objects are always of the correct number?

In this example, could I modify one of the factories such that a "Car"
object is always created with 4 "Tire" child objects?

TIA

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="simple"
nsURI="http://nunjobiznezz.com/emf/simple" nsPrefix="simple">
<eClassifiers xsi:type="ecore:EClass" name="Car">
<eStructuralFeatures xsi:type="ecore:EReference" name="tires"
lowerBound="4" upperBound="4"
eType="#//Tires" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Tires"/>
</ecore:EPackage>
Previous Topic:[Announce] Eclipse Modeling Days
Next Topic:UML elements already stereotyped in the palette to drag and drop onto the editor
Goto Forum:
  


Current Time: Sun Apr 20 12:38:16 EDT 2014

Powered by FUDForum. Page generated in 0.02513 seconds