Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Static Profiles and predefined type system
Static Profiles and predefined type system [message #530889] Sun, 02 May 2010 07:56 Go to next message
Timothy Marc is currently offline Timothy Marc
Messages: 547
Registered: July 2009
Senior Member
Hi all,

i want to implement a UML profile that contains a dedicated type system
like a Timer (UML::DataType), etc. Therefor i created two uml files, one
with its root element being a 'Profile' (the core profile specification)
and one containing the predefined types (mostly UML::DataTypes).

But how could that be realized with static profiles? I tried to type an
attribute of the stereotype (eclass) with both UML::DataType and
MyProfile::Timer. The problem is that this requires the separate uml
file to be converted to Ecore too. But by doing so, how is it possible
to reuse the timer in a UML model that has the profile applied? If i
convert the UML predefined types into an Ecore model, it is not anymore
compatible with UML.

The idea with the timer is that a class must contain a timer-typed
attribute so that the stereotype (within a interaction) can point to
that timer by pointing to that timer. (Stereotype::timerRef:Timer). So
both the profile and a system model should reuse the predefined types.

With dynamic profiles, this is quite easy to realize since the
conversion step is not included, but i want to make use of the
advantages of static profiles anyway.

Can anyone give me a hint how to realize this?

Thanks in advance, Timothy
Re: Static Profiles and predefined type system [message #531043 is a reply to message #530889] Mon, 03 May 2010 09:21 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. Damus
Messages: 768
Registered: July 2009
Senior Member
Hi, Timothy,

Your model that has the profile applied should import or reference the
UML model defining your type library. This is no different than what
UML, itself, does in using its primitive types library.

When you eventually generate code from the profiled UML model, its
genmodel will have to reference the genmodels of your profile and your
type library to ensure that everything is consistently linked up in the
generated code. You could generate the profile and library separately
in different plug-ins (using separate genmodels) or together in one
plug-in (one genmodel). I guess it would matter most if you need to use
the library independently of the profile ...

HTH,

Christian


On 02/05/10 07:56 AM, Timothy Marc wrote:
> Hi all,
>
> i want to implement a UML profile that contains a dedicated type system
> like a Timer (UML::DataType), etc. Therefor i created two uml files, one
> with its root element being a 'Profile' (the core profile specification)
> and one containing the predefined types (mostly UML::DataTypes).
>
> But how could that be realized with static profiles? I tried to type an
> attribute of the stereotype (eclass) with both UML::DataType and
> MyProfile::Timer. The problem is that this requires the separate uml
> file to be converted to Ecore too. But by doing so, how is it possible
> to reuse the timer in a UML model that has the profile applied? If i
> convert the UML predefined types into an Ecore model, it is not anymore
> compatible with UML.
>
> The idea with the timer is that a class must contain a timer-typed
> attribute so that the stereotype (within a interaction) can point to
> that timer by pointing to that timer. (Stereotype::timerRef:Timer). So
> both the profile and a system model should reuse the predefined types.
>
> With dynamic profiles, this is quite easy to realize since the
> conversion step is not included, but i want to make use of the
> advantages of static profiles anyway.
>
> Can anyone give me a hint how to realize this?
>
> Thanks in advance, Timothy
Re: Static Profiles and predefined type system [message #531100 is a reply to message #531043] Mon, 03 May 2010 12:36 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy Marc
Messages: 547
Registered: July 2009
Senior Member
Hi Christian,

maybe me explanation was a bit confusing. I didn't want to generate code
from the profiled uml model, but to make use of static profile with
predefined uml types.

You said

> Your model that has the profile applied should import or reference the
> UML model defining your type library.

Again the question: I have to convert the type library into Ecore in
order to make use of them within my static profile. But i didn't want
the type system to be another metamodel, but rather a UML library. Maybe
i have a misunderstanding how the static profile mechanism works, but
is it possible to reference the UML library from within the UML
model-to-profile (adding a property of type 'Timer' which is a
UML::DataType) and referencing the same type within the profile's ecore
representation. In this case, not the UML type 'Timer' is referenced
directly, but rather its Ecore representation... i'm not sure whether
these bothe representations will work together without problems?! Or is
the UML library just mapped to the Ecore representation of the library?

Am I understandable???? ;-)

Timothy

Christian W. Damus schrieb:
> Hi, Timothy,
>
> Your model that has the profile applied should import or reference the
> UML model defining your type library. This is no different than what
> UML, itself, does in using its primitive types library.
>
> When you eventually generate code from the profiled UML model, its
> genmodel will have to reference the genmodels of your profile and your
> type library to ensure that everything is consistently linked up in the
> generated code. You could generate the profile and library separately
> in different plug-ins (using separate genmodels) or together in one
> plug-in (one genmodel). I guess it would matter most if you need to use
> the library independently of the profile ...
>
> HTH,
>
> Christian
>
>
> On 02/05/10 07:56 AM, Timothy Marc wrote:
>> Hi all,
>>
>> i want to implement a UML profile that contains a dedicated type system
>> like a Timer (UML::DataType), etc. Therefor i created two uml files, one
>> with its root element being a 'Profile' (the core profile specification)
>> and one containing the predefined types (mostly UML::DataTypes).
>>
>> But how could that be realized with static profiles? I tried to type an
>> attribute of the stereotype (eclass) with both UML::DataType and
>> MyProfile::Timer. The problem is that this requires the separate uml
>> file to be converted to Ecore too. But by doing so, how is it possible
>> to reuse the timer in a UML model that has the profile applied? If i
>> convert the UML predefined types into an Ecore model, it is not anymore
>> compatible with UML.
>>
>> The idea with the timer is that a class must contain a timer-typed
>> attribute so that the stereotype (within a interaction) can point to
>> that timer by pointing to that timer. (Stereotype::timerRef:Timer). So
>> both the profile and a system model should reuse the predefined types.
>>
>> With dynamic profiles, this is quite easy to realize since the
>> conversion step is not included, but i want to make use of the
>> advantages of static profiles anyway.
>>
>> Can anyone give me a hint how to realize this?
>>
>> Thanks in advance, Timothy
>
Re: Static Profiles and predefined type system [message #531132 is a reply to message #531100] Mon, 03 May 2010 16:01 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 768
Registered: July 2009
Senior Member
Hi, Timothy,

Yes, I think you're certainly understandable. But, that doesn't mean
that I will understand. :-) I can be rather thick at times.

The statically-generated profile is a UML model regardless of whether
its Ecore definition is dynamic or static. So, its UML definition must
necessarily reference the UML definition of your library types. The
model to which you apply your profile can reference these same types in
the same way.

What you are trying to do seems to me identical to what the UML
metamodel already does its primitive types library, and what you
doubtless have done with it, yourself. I'm sure that you can define
properties of type String in your model and in your profile, and apply
the profile to your model to apply stereotypes with these string
properties. None of your types needs be fundamentally different from
String. Note that the UML primitive types are already statically mapped
to Ecore, not by code generation but as a special case.

There is no practical difference between a "metamodel" and a "model
library" except in its intended usage. Your Timer and other data types
need to be defined in a UML model that can be referenced by both your
profile and by any models that have the profile applied. These are de
facto model libraries (you can take the extra step of stereotyping the
root package as <<modelLibrary>> but I don't think that it's necessary).

So, in summary:

- UML profile P uses types from UML library L
- UML profile P generates Ecore package Pe
- UML library L generates Ecore package Le
- GenModel Pg can reference GenModel Lg or it can
generate Le
- UML model U applies UML profile P
- UML model U uses types from UML library L

You need an Ecore definition of the type library in order to generate a
complete Ecore definition of the profile. But, this has no bearing on
using the type library in your user model. If something doesn't work on
the UML level in this scenario, then that would be a bug in UML2.

HTH,

Christian


On 03/05/10 12:36 PM, Timothy Marc wrote:
> Hi Christian,
>
> maybe me explanation was a bit confusing. I didn't want to generate code
> from the profiled uml model, but to make use of static profile with
> predefined uml types.
>
> You said
>
> > Your model that has the profile applied should import or reference the
> > UML model defining your type library.
>
> Again the question: I have to convert the type library into Ecore in
> order to make use of them within my static profile. But i didn't want
> the type system to be another metamodel, but rather a UML library. Maybe
> i have a misunderstanding how the static profile mechanism works, but is
> it possible to reference the UML library from within the UML
> model-to-profile (adding a property of type 'Timer' which is a
> UML::DataType) and referencing the same type within the profile's ecore
> representation. In this case, not the UML type 'Timer' is referenced
> directly, but rather its Ecore representation... i'm not sure whether
> these bothe representations will work together without problems?! Or is
> the UML library just mapped to the Ecore representation of the library?
>
> Am I understandable???? ;-)
>
> Timothy
>
> Christian W. Damus schrieb:
>> Hi, Timothy,
>>
>> Your model that has the profile applied should import or reference the
>> UML model defining your type library. This is no different than what
>> UML, itself, does in using its primitive types library.
>>
>> When you eventually generate code from the profiled UML model, its
>> genmodel will have to reference the genmodels of your profile and your
>> type library to ensure that everything is consistently linked up in
>> the generated code. You could generate the profile and library
>> separately in different plug-ins (using separate genmodels) or
>> together in one plug-in (one genmodel). I guess it would matter most
>> if you need to use the library independently of the profile ...
>>
>> HTH,
>>
>> Christian
>>

--------8<--------
Re: Static Profiles and predefined type system [message #628430 is a reply to message #530889] Mon, 03 May 2010 09:21 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 768
Registered: July 2009
Senior Member
Hi, Timothy,

Your model that has the profile applied should import or reference the
UML model defining your type library. This is no different than what
UML, itself, does in using its primitive types library.

When you eventually generate code from the profiled UML model, its
genmodel will have to reference the genmodels of your profile and your
type library to ensure that everything is consistently linked up in the
generated code. You could generate the profile and library separately
in different plug-ins (using separate genmodels) or together in one
plug-in (one genmodel). I guess it would matter most if you need to use
the library independently of the profile ...

HTH,

Christian


On 02/05/10 07:56 AM, Timothy Marc wrote:
> Hi all,
>
> i want to implement a UML profile that contains a dedicated type system
> like a Timer (UML::DataType), etc. Therefor i created two uml files, one
> with its root element being a 'Profile' (the core profile specification)
> and one containing the predefined types (mostly UML::DataTypes).
>
> But how could that be realized with static profiles? I tried to type an
> attribute of the stereotype (eclass) with both UML::DataType and
> MyProfile::Timer. The problem is that this requires the separate uml
> file to be converted to Ecore too. But by doing so, how is it possible
> to reuse the timer in a UML model that has the profile applied? If i
> convert the UML predefined types into an Ecore model, it is not anymore
> compatible with UML.
>
> The idea with the timer is that a class must contain a timer-typed
> attribute so that the stereotype (within a interaction) can point to
> that timer by pointing to that timer. (Stereotype::timerRef:Timer). So
> both the profile and a system model should reuse the predefined types.
>
> With dynamic profiles, this is quite easy to realize since the
> conversion step is not included, but i want to make use of the
> advantages of static profiles anyway.
>
> Can anyone give me a hint how to realize this?
>
> Thanks in advance, Timothy
Re: Static Profiles and predefined type system [message #628431 is a reply to message #531043] Mon, 03 May 2010 12:36 Go to previous message
Timothy Marc is currently offline Timothy Marc
Messages: 547
Registered: July 2009
Senior Member
Hi Christian,

maybe me explanation was a bit confusing. I didn't want to generate code
from the profiled uml model, but to make use of static profile with
predefined uml types.

You said

> Your model that has the profile applied should import or reference the
> UML model defining your type library.

Again the question: I have to convert the type library into Ecore in
order to make use of them within my static profile. But i didn't want
the type system to be another metamodel, but rather a UML library. Maybe
i have a misunderstanding how the static profile mechanism works, but
is it possible to reference the UML library from within the UML
model-to-profile (adding a property of type 'Timer' which is a
UML::DataType) and referencing the same type within the profile's ecore
representation. In this case, not the UML type 'Timer' is referenced
directly, but rather its Ecore representation... i'm not sure whether
these bothe representations will work together without problems?! Or is
the UML library just mapped to the Ecore representation of the library?

Am I understandable???? ;-)

Timothy

Christian W. Damus schrieb:
> Hi, Timothy,
>
> Your model that has the profile applied should import or reference the
> UML model defining your type library. This is no different than what
> UML, itself, does in using its primitive types library.
>
> When you eventually generate code from the profiled UML model, its
> genmodel will have to reference the genmodels of your profile and your
> type library to ensure that everything is consistently linked up in the
> generated code. You could generate the profile and library separately
> in different plug-ins (using separate genmodels) or together in one
> plug-in (one genmodel). I guess it would matter most if you need to use
> the library independently of the profile ...
>
> HTH,
>
> Christian
>
>
> On 02/05/10 07:56 AM, Timothy Marc wrote:
>> Hi all,
>>
>> i want to implement a UML profile that contains a dedicated type system
>> like a Timer (UML::DataType), etc. Therefor i created two uml files, one
>> with its root element being a 'Profile' (the core profile specification)
>> and one containing the predefined types (mostly UML::DataTypes).
>>
>> But how could that be realized with static profiles? I tried to type an
>> attribute of the stereotype (eclass) with both UML::DataType and
>> MyProfile::Timer. The problem is that this requires the separate uml
>> file to be converted to Ecore too. But by doing so, how is it possible
>> to reuse the timer in a UML model that has the profile applied? If i
>> convert the UML predefined types into an Ecore model, it is not anymore
>> compatible with UML.
>>
>> The idea with the timer is that a class must contain a timer-typed
>> attribute so that the stereotype (within a interaction) can point to
>> that timer by pointing to that timer. (Stereotype::timerRef:Timer). So
>> both the profile and a system model should reuse the predefined types.
>>
>> With dynamic profiles, this is quite easy to realize since the
>> conversion step is not included, but i want to make use of the
>> advantages of static profiles anyway.
>>
>> Can anyone give me a hint how to realize this?
>>
>> Thanks in advance, Timothy
>
Re: Static Profiles and predefined type system [message #628432 is a reply to message #531100] Mon, 03 May 2010 16:01 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 768
Registered: July 2009
Senior Member
Hi, Timothy,

Yes, I think you're certainly understandable. But, that doesn't mean
that I will understand. :-) I can be rather thick at times.

The statically-generated profile is a UML model regardless of whether
its Ecore definition is dynamic or static. So, its UML definition must
necessarily reference the UML definition of your library types. The
model to which you apply your profile can reference these same types in
the same way.

What you are trying to do seems to me identical to what the UML
metamodel already does its primitive types library, and what you
doubtless have done with it, yourself. I'm sure that you can define
properties of type String in your model and in your profile, and apply
the profile to your model to apply stereotypes with these string
properties. None of your types needs be fundamentally different from
String. Note that the UML primitive types are already statically mapped
to Ecore, not by code generation but as a special case.

There is no practical difference between a "metamodel" and a "model
library" except in its intended usage. Your Timer and other data types
need to be defined in a UML model that can be referenced by both your
profile and by any models that have the profile applied. These are de
facto model libraries (you can take the extra step of stereotyping the
root package as <<modelLibrary>> but I don't think that it's necessary).

So, in summary:

- UML profile P uses types from UML library L
- UML profile P generates Ecore package Pe
- UML library L generates Ecore package Le
- GenModel Pg can reference GenModel Lg or it can
generate Le
- UML model U applies UML profile P
- UML model U uses types from UML library L

You need an Ecore definition of the type library in order to generate a
complete Ecore definition of the profile. But, this has no bearing on
using the type library in your user model. If something doesn't work on
the UML level in this scenario, then that would be a bug in UML2.

HTH,

Christian


On 03/05/10 12:36 PM, Timothy Marc wrote:
> Hi Christian,
>
> maybe me explanation was a bit confusing. I didn't want to generate code
> from the profiled uml model, but to make use of static profile with
> predefined uml types.
>
> You said
>
> > Your model that has the profile applied should import or reference the
> > UML model defining your type library.
>
> Again the question: I have to convert the type library into Ecore in
> order to make use of them within my static profile. But i didn't want
> the type system to be another metamodel, but rather a UML library. Maybe
> i have a misunderstanding how the static profile mechanism works, but is
> it possible to reference the UML library from within the UML
> model-to-profile (adding a property of type 'Timer' which is a
> UML::DataType) and referencing the same type within the profile's ecore
> representation. In this case, not the UML type 'Timer' is referenced
> directly, but rather its Ecore representation... i'm not sure whether
> these bothe representations will work together without problems?! Or is
> the UML library just mapped to the Ecore representation of the library?
>
> Am I understandable???? ;-)
>
> Timothy
>
> Christian W. Damus schrieb:
>> Hi, Timothy,
>>
>> Your model that has the profile applied should import or reference the
>> UML model defining your type library. This is no different than what
>> UML, itself, does in using its primitive types library.
>>
>> When you eventually generate code from the profiled UML model, its
>> genmodel will have to reference the genmodels of your profile and your
>> type library to ensure that everything is consistently linked up in
>> the generated code. You could generate the profile and library
>> separately in different plug-ins (using separate genmodels) or
>> together in one plug-in (one genmodel). I guess it would matter most
>> if you need to use the library independently of the profile ...
>>
>> HTH,
>>
>> Christian
>>

--------8<--------
Previous Topic:how to create object diagram using UML 2 eclipse tool
Next Topic:Apply Ecore stereotype in UML2 editor
Goto Forum:
  


Current Time: Fri Aug 22 00:14:12 EDT 2014

Powered by FUDForum. Page generated in 0.02268 seconds