[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.uml2] Re: extending UML2

Kenn,

Thanks for the prompt reply again, i thought the same.
Is it possible to use the FeatureMap ? I read a tutorial about FeatureMaps
As you said  when call getFA() on an instance of ARModel you'll only

> get something back if it contains instances of FA (even though it might
> contain a package stereotyped as <<FA>> in its list of owned members).
> Similarly, calling getAR() on an instance of FA will only return instances
> of AR (even though it might contain a class stereotyped as <<AR>> in its
> list of owned members)...

If Ar::fa is a derived feature from ownedMembers will it work , or is there 
a way
we could use dervied features to get both <stereotyped FA > and FA..!!

Thanks,
Saurabh

"Kenn Hussey" <khussey@xxxxxxxxxx> wrote in message 
news:e9jdtl$evh$1@xxxxxxxxxxxxxxxxxxxx
> Saurabh,
>
> There's no automatic correlation between an instance of an EMF-based
> metamodel that extends the UML metamodel and a stereotyped UML model. You
> can use the UML2 API to manipulate both, but an MA is not considered
> equivalent to a property stereotyped as <<MA>>. The result you get when
> calling the accessors in your generated API will depend on how you have
> defined the associated features (ARModel::fa, FA::ar, and AR::ma), but I
> would expect that if you call getFA() on an instance of ARModel, you'll 
> only
> get something back if it contains instances of FA (even though it might
> contain a package stereotyped as <<FA>> in its list of owned members).
> Similarly, calling getAR() on an instance of FA will only return instances
> of AR (even though it might contain a class stereotyped as <<AR>> in its
> list of owned members)...
>
> Kenn
>
> "saurabh" <8bholas@xxxxxxxxxx> wrote in message
> news:e9j2la$kht$1@xxxxxxxxxxxxxxxxxxxx
>> Ken,
>>
>> Thanks for your prompt reply, I am asking all these questions because i 
>> am
> a
>> bit confused, below is the reason for my confusion and i am still looking
>> for a solution.
>>
>> We have a uml model  (model1.uml) to which we apply a profile , say
> profile
>> A
>>
>> We have another EMF model which extends the UML2 metamodel , the idea is
>> to have an affect similar to rpofile A above. We generate code using the
> EMF
>> model and the UI uses this generated code to manipulate the model.
>>
>> We want the same UI to manipulate (model1.uml) rather than our model 
>> based
>> on
>> EMF generated code, the example would be -
>>
>> in  model1.uml  - we would have something like
>>     <Model> model1
>>      <Package> <<stereotype FA>>
>>      <Class> <<stereotype AR>>
>>               <Property> < <<stereotype MA>>  : this being child of AR or
>> property of a Class
>>
>> in EMF based model (emfModel.req) - we would have something like
>>     <ARModel>
>>      <FA>
>>     <AR>
>>         <MA> : AR above has a reference to <MA>
>>
>> as generated model objects , FA extends <Package> and AR extends <Class>
>> ARModel extends <Model> and MA extends <Property>
>> when i create this model, i use factory.createArModel()
> ,factory.createFA()
>> and factory.createAR() , factory.createMA() and i get
>> the instance of ARModel, AR and FA and MA which i add ot the resource
> using
>> :
>>
>> AR.getMA().add(MA);
>> FA.getAr().add(AR);
>> ARModel.getFA().add(fa);
>>
>> If i use the same (which is used to manipulate emfModel.req) EMF 
>> generated
>> API  to manipulate  model1.uml , then say for example the user
>> sees the above model1.uml  arepresented as tree  in the UI . When the 
>> user
>> selects <Class> <<stereotype AR>>
>> as input on the tree and say tries to add  MA, it will be something like
>> class.getOwnedMembers().add(MA), it can
>> be done as MA extends UML <Property>  the model1.uml now looks like the
>> following.
>>
>>   <Model> model1
>>      <Package> <<stereotype FA>>
>>      <Class> <<stereotype AR>>
>>               <Property> < <<stereotype MA>>  : this being child of AR or
>> property of a Class
>>                <MA>
>>
>> Now the problem is when i call  model.getFA() will i get returned a list
> of
>> Packages ..? or nothing as i don't have any <FA> objects
>> and if i call model.getAR() will i get returned a list of Classes? or a
> list
>> of <AR> objects etc?
>>
>> That's my confusion...!! Please let me know if you can understand what i
> am
>> trying to say??
>>
>> Saurabh
>>
>>
>> "Kenn Hussey" <khussey@xxxxxxxxxx> wrote in message
>> news:e9im1o$8c7$1@xxxxxxxxxxxxxxxxxxxx
>> > Saurabh,
>> >
>> > The UML2 importer and code generator will behave the same way 
>> > regardless
>> > of
>> > whether you've applied stereotypes from your profile to the model. Only
>> > the
>> > built-in Ecore profile will have an effect on code generation, because
> its
>> > purpose is to customize a UML model with concepts that are specific to
>> > Ecore
>> > (EMF).
>> >
>> > Kenn
>> >
>> > "saurabh" <8bholas@xxxxxxxxxx> wrote in message
>> > news:e9ijfu$nlr$1@xxxxxxxxxxxxxxxxxxxx
>> >> Extending UML2 using Profiles -
>> >>
>> >> I have extended UML2 using a profile. I want to know if the code
>> >> generator
>> >> will generate code in the same way when i use a my own metaModel to
>> >> extend
>> >> UML2, if not then what is the way around it..?
>> >>
>> >> Saurabh
>> >>
>> >>
>> >
>> >
>>
>>
>
>