Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Model Question.
Model Question. [message #427508] Thu, 19 February 2009 18:23 Go to next message
Suresh Subramanian is currently offline Suresh SubramanianFriend
Messages: 61
Registered: July 2009
Member
Hi,

I have a model B which has the containment hierarchy.

BType {
name:String,
chidlObject1ref:childObject1Type,
childlObject2ref:childObject2Type
}
ChidObject1Type {
name:String,
.....
}
ChildObject2Type {
name:string,
....
}
where childObject1Type and childObjectType are objectTypes defined in the
same package where BType is defined.
And another model A which should be

AType {
uri:String,
bRef: BTypeReference
operation; EnumTypevalue
}
Where AType is in different package. This is kind of query support.

I need to write a model B But the A is already existing, When instanciating
A Object, depending the operation value A instance should have the children
which are of the children of BType Object instance.I am not sure this can be
possible in EMF or not. Some help is appriciated.

to be more specific.,

BObectInstance is like this,

Binstance {
"foo",
childObject1ref {
"bar"
}
chidlObject2ref {
"junk"
}
}

AInstnace {
uri="auri"
bref = "BInstance"
operation="childobject1typeonly"
<bar>
<if bar has child elements then those child elements name should be child
elements here>
/** if operation="childobject2typeonly" then all the content should
childobject2type elements NOT the childobject1type**/
}

Thanks
Suresh Subramanian
Re: Model Question. [message #427513 is a reply to message #427508] Thu, 19 February 2009 18:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Suresh,

I can't say I've entirely understood what you're describing. Your model
will likely have to be general enough to allow even ill formed instance
and then you'll have to define constraints to diagnose those bad forms.
You'll be able to specialize the editor to prevent the user from
creating such bad forms.


Suresh Subramanian wrote:
> Hi,
>
> I have a model B which has the containment hierarchy.
>
> BType {
> name:String,
> chidlObject1ref:childObject1Type,
> childlObject2ref:childObject2Type
> }
> ChidObject1Type {
> name:String,
> ....
> }
> ChildObject2Type {
> name:string,
> ...
> }
> where childObject1Type and childObjectType are objectTypes defined in the
> same package where BType is defined.
> And another model A which should be
>
> AType {
> uri:String,
> bRef: BTypeReference
> operation; EnumTypevalue
> }
> Where AType is in different package. This is kind of query support.
>
> I need to write a model B But the A is already existing, When instanciating
> A Object, depending the operation value A instance should have the children
> which are of the children of BType Object instance.I am not sure this can be
> possible in EMF or not. Some help is appriciated.
>
> to be more specific.,
>
> BObectInstance is like this,
>
> Binstance {
> "foo",
> childObject1ref {
> "bar"
> }
> chidlObject2ref {
> "junk"
> }
> }
>
> AInstnace {
> uri="auri"
> bref = "BInstance"
> operation="childobject1typeonly"
> <bar>
> <if bar has child elements then those child elements name should be child
> elements here>
> /** if operation="childobject2typeonly" then all the content should
> childobject2type elements NOT the childobject1type**/
> }
>
> Thanks
> Suresh Subramanian
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Model Question. [message #427520 is a reply to message #427513] Thu, 19 February 2009 20:00 Go to previous messageGo to next message
Suresh Subramanian is currently offline Suresh SubramanianFriend
Messages: 61
Registered: July 2009
Member
Thanks Ed for your response. Probably i need to explain more clearly.

following is the fragment. of model Object Type BType i referred in my
previous mail

<ManagedResource name="mr1>

<Config Data name="configdata1"> /** this is the
childObject1Type i am referring **/

<attribute name ="attribute1"/>

<attribute name="attribute2"/>

</Config Data>

</ManagedResource>



It is entirely in different Resource.



In another resouce in AType if i don't specify any thing in operation
default behaviour and create A instance in my editor



<AInstance uri="some text", bref="mr1', operation="defalut"/>

then <AInstance should looklike and saved as follows.



<AInstance uri="some text" bref="mr1" operation="default">

<mr1>

<configdata1> /*child object contents need to be displayed.*/

<attribute1/>

</attribute2/>

</configdata1>

</AInstance>

If the operation is different such that other object need to be displayed,
then <mr1> content shouldnot have <configdata1>, instead it should be the
content matching with the filtering criterio specified in the operation.
After that similar to XML editor if i need add another node of any type in
any node in the above, i should be able to do that. I am not sure how to
define this model for A instance. Is it possible first of all.



hope this explains better.



Thanks,

Suresh Subramanian



"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:gnka6i$cik$1@build.eclipse.org...
> Suresh,
>
> I can't say I've entirely understood what you're describing. Your model
> will likely have to be general enough to allow even ill formed instance
> and then you'll have to define constraints to diagnose those bad forms.
> You'll be able to specialize the editor to prevent the user from creating
> such bad forms.
>
>
> Suresh Subramanian wrote:
>> Hi,
>>
>> I have a model B which has the containment hierarchy.
>>
>> BType {
>> name:String,
>> chidlObject1ref:childObject1Type,
>> childlObject2ref:childObject2Type
>> }
>> ChidObject1Type {
>> name:String,
>> ....
>> }
>> ChildObject2Type {
>> name:string,
>> ...
>> }
>> where childObject1Type and childObjectType are objectTypes defined in the
>> same package where BType is defined.
>> And another model A which should be
>>
>> AType {
>> uri:String,
>> bRef: BTypeReference
>> operation; EnumTypevalue
>> }
>> Where AType is in different package. This is kind of query support.
>>
>> I need to write a model B But the A is already existing, When
>> instanciating A Object, depending the operation value A instance should
>> have the children which are of the children of BType Object instance.I am
>> not sure this can be possible in EMF or not. Some help is appriciated.
>>
>> to be more specific.,
>>
>> BObectInstance is like this,
>>
>> Binstance {
>> "foo",
>> childObject1ref {
>> "bar"
>> }
>> chidlObject2ref {
>> "junk"
>> }
>> }
>>
>> AInstnace {
>> uri="auri"
>> bref = "BInstance"
>> operation="childobject1typeonly"
>> <bar>
>> <if bar has child elements then those child elements name should be
>> child elements here>
>> /** if operation="childobject2typeonly" then all the content should
>> childobject2type elements NOT the childobject1type**/
>> }
>>
>> Thanks
>> Suresh Subramanian
>>
>>
Re: Model Question. [message #427523 is a reply to message #427520] Thu, 19 February 2009 20:30 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090603020801050407070603
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Suresh,

Comments below.

Suresh Subramanian wrote:
> Thanks Ed for your response. Probably i need to explain more clearly.
>
> following is the fragment. of model Object Type BType i referred in my
> previous mail
>
It's like your casing and punctuation is random. That doesn't help...
> <ManagedResource name="mr1>
>
> <Config Data name="configdata1"> /** this is the
> childObject1Type i am referring **/
>
> <attribute name ="attribute1"/>
>
> <attribute name="attribute2"/>
>
> </Config Data>
>
> </ManagedResource>
>
>
>
> It is entirely in different Resource.
>
Different from?
>
>
> In another resouce in AType
What does it mean for a resource to be in AType?
> if i don't specify any thing in operation
>
What operation?
> default behaviour and create A instance in my editor
>
>
>
> <AInstance uri="some text", bref="mr1', operation="defalut"/>
>
> then <AInstance should looklike and saved as follows.
>
>
>
> <AInstance uri="some text" bref="mr1" operation="default">
>
> <mr1>
>
> <configdata1> /*child object contents need to be displayed.*/
>
> <attribute1/>
>
> </attribute2/>
>
> </configdata1>
>
> </AInstance>
>
> If the operation is different such that other object need to be displayed,
> then <mr1> content shouldnot have <configdata1>, instead it should be the
> content matching with the filtering criterio specified in the operation.
>
This all hurts my brain.
> After that similar to XML editor if i need add another node of any type in
> any node in the above, i should be able to do that. I am not sure how to
> define this model for A instance. Is it possible first of all.
>
>
>
> hope this explains better.
>
Not so much no...

You can have features of type EObject, which in XML Schema you'd define
as xsd:anyType. Such features can contain anything.
>
>
> Thanks,
>
> Suresh Subramanian
>
>
>
> "Ed Merks" <Ed.Merks@gmail.com> wrote in message
> news:gnka6i$cik$1@build.eclipse.org...
>
>> Suresh,
>>
>> I can't say I've entirely understood what you're describing. Your model
>> will likely have to be general enough to allow even ill formed instance
>> and then you'll have to define constraints to diagnose those bad forms.
>> You'll be able to specialize the editor to prevent the user from creating
>> such bad forms.
>>
>>
>> Suresh Subramanian wrote:
>>
>>> Hi,
>>>
>>> I have a model B which has the containment hierarchy.
>>>
>>> BType {
>>> name:String,
>>> chidlObject1ref:childObject1Type,
>>> childlObject2ref:childObject2Type
>>> }
>>> ChidObject1Type {
>>> name:String,
>>> ....
>>> }
>>> ChildObject2Type {
>>> name:string,
>>> ...
>>> }
>>> where childObject1Type and childObjectType are objectTypes defined in the
>>> same package where BType is defined.
>>> And another model A which should be
>>>
>>> AType {
>>> uri:String,
>>> bRef: BTypeReference
>>> operation; EnumTypevalue
>>> }
>>> Where AType is in different package. This is kind of query support.
>>>
>>> I need to write a model B But the A is already existing, When
>>> instanciating A Object, depending the operation value A instance should
>>> have the children which are of the children of BType Object instance.I am
>>> not sure this can be possible in EMF or not. Some help is appriciated.
>>>
>>> to be more specific.,
>>>
>>> BObectInstance is like this,
>>>
>>> Binstance {
>>> "foo",
>>> childObject1ref {
>>> "bar"
>>> }
>>> chidlObject2ref {
>>> "junk"
>>> }
>>> }
>>>
>>> AInstnace {
>>> uri="auri"
>>> bref = "BInstance"
>>> operation="childobject1typeonly"
>>> <bar>
>>> <if bar has child elements then those child elements name should be
>>> child elements here>
>>> /** if operation="childobject2typeonly" then all the content should
>>> childobject2type elements NOT the childobject1type**/
>>> }
>>>
>>> Thanks
>>> Suresh Subramanian
>>>
>>>
>>>
>
>
>

--------------090603020801050407070603
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Suresh,<br>
<br>
Comments below.<br>
<br>
Suresh Subramanian wrote:
<blockquote cite="mid:gnkdpc$8qg$1@build.eclipse.org" type="cite">
<pre wrap="">Thanks Ed for your response. Probably i need to explain more clearly.

following is the fragment. of model Object Type BType i referred in my
previous mail
</pre>
</blockquote>
It's like your casing and punctuation is random.&nbsp; That doesn't help...<br>
<blockquote cite="mid:gnkdpc$8qg$1@build.eclipse.org" type="cite">
<pre wrap="">
&lt;ManagedResource name="mr1&gt;

&lt;Config Data name="configdata1"&gt; /** this is the
childObject1Type i am referring **/

&lt;attribute name ="attribute1"/&gt;

&lt;attribute name="attribute2"/&gt;

&lt;/Config Data&gt;

&lt;/ManagedResource&gt;



It is entirely in different Resource.
</pre>
</blockquote>
Different from?<br>
<blockquote cite="mid:gnkdpc$8qg$1@build.eclipse.org" type="cite">
<pre wrap="">


In another resouce in AType</pre>
</blockquote>
What does it mean for a resource to be in AType?<br>
<blockquote cite="mid:gnkdpc$8qg$1@build.eclipse.org" type="cite">
<pre wrap=""> if i don't specify any thing in operation
</pre>
</blockquote>
What operation?<br>
<blockquote cite="mid:gnkdpc$8qg$1@build.eclipse.org" type="cite">
<pre wrap="">default behaviour and create A instance in my editor



&lt;AInstance uri="some text", bref="mr1', operation="defalut"/&gt;

then &lt;AInstance should looklike and saved as follows.



&lt;AInstance uri="some text" bref="mr1" operation="default"&gt;

&lt;mr1&gt;

&lt;configdata1&gt; /*child object contents need to be displayed.*/

&lt;attribute1/&gt;

&lt;/attribute2/&gt;

&lt;/configdata1&gt;

&lt;/AInstance&gt;

If the operation is different such that other object need to be displayed,
then &lt;mr1&gt; content shouldnot have &lt;configdata1&gt;, instead it should be the
content matching with the filtering criterio specified in the operation.
</pre>
</blockquote>
This all hurts my brain.<br>
<blockquote cite="mid:gnkdpc$8qg$1@build.eclipse.org" type="cite">
<pre wrap="">After that similar to XML editor if i need add another node of any type in
any node in the above, i should be able to do that. I am not sure how to
define this model for A instance. Is it possible first of all.



hope this explains better.
</pre>
</blockquote>
Not so much no...<br>
<br>
You can have features of type EObject, which in XML Schema you'd define
as xsd:anyType.&nbsp; Such features can contain anything.<br>
<blockquote cite="mid:gnkdpc$8qg$1@build.eclipse.org" type="cite">
<pre wrap="">


Thanks,

Suresh Subramanian



"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:gnka6i$cik$1@build.eclipse.org">news:gnka6i$cik$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Suresh,

I can't say I've entirely understood what you're describing. Your model
will likely have to be general enough to allow even ill formed instance
and then you'll have to define constraints to diagnose those bad forms.
You'll be able to specialize the editor to prevent the user from creating
such bad forms.


Suresh Subramanian wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,

I have a model B which has the containment hierarchy.

BType {
name:String,
chidlObject1ref:childObject1Type,
childlObject2ref:childObject2Type
}
ChidObject1Type {
name:String,
.....
}
ChildObject2Type {
name:string,
....
}
where childObject1Type and childObjectType are objectTypes defined in the
same package where BType is defined.
And another model A which should be

AType {
uri:String,
bRef: BTypeReference
operation; EnumTypevalue
}
Where AType is in different package. This is kind of query support.

I need to write a model B But the A is already existing, When
instanciating A Object, depending the operation value A instance should
have the children which are of the children of BType Object instance.I am
not sure this can be possible in EMF or not. Some help is appriciated.

to be more specific.,

BObectInstance is like this,

Binstance {
"foo",
childObject1ref {
"bar"
}
chidlObject2ref {
"junk"
}
}

AInstnace {
uri="auri"
bref = "BInstance"
operation="childobject1typeonly"
&lt;bar&gt;
&lt;if bar has child elements then those child elements name should be
child elements here&gt;
/** if operation="childobject2typeonly" then all the content should
childobject2type elements NOT the childobject1type**/
}

Thanks
Suresh Subramanian


</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</body>
</html>

--------------090603020801050407070603--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Teneo] DuplicateMappingException
Next Topic:Teneo/Hibernate NonUniqueObjectException resolving
Goto Forum:
  


Current Time: Thu Apr 25 19:51:36 GMT 2024

Powered by FUDForum. Page generated in 0.03088 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top