|Re: Specifying constraints at Model Instance (M0) level [message #670899]
||Mon, 16 May 2011 06:28
| Ed Willink
Registered: July 2009
You have a software problem that is amenable to programming, so of
course it can be done, it just depends on the costs and compromises atht
are acceptable to you and your users.
With modelling you define at M(n+1) what happens at M(n), so the
behaviour at M0 is defined at M1, so if you want your users to be able
tailor the behaviour of instances at M0 homogeneously, that is an M1
activity. If you want to tailor instances heterogeneously that is
nominally an M0 activity, but you need to configure it as an M1 capability.
Thus configuration of Ball instances to support distinctive colours
requires a Ball::color attribute at M1.
More generally, configuration of mixed behaviours may be modelled by a
Person::roles in which roles is a set Roles applicable to a Person. Some
advanced modeling research endeavours to make Role a first class
modeling concept. Thus a Person, may have a Father, Son, Employee,
Manager, Driver, TaxExile, Buddhist, etc etc role and these roles may
change without requiring redefinition of the Person class.
On 16/05/2011 06:56, Nidhi wrote:
> I am re-posting my earlier question (posted in the EMFT
> forum) regarding defining expressions at Model Instance
> My usecase is the following:
> 1. My domain Ecore model contains the following entities:
> - parameters : Parameter
> 2. On declaratively instantiating this model, the end user
> creates the following entities:
> Customer (corresponding to Stakeholder)
> - CustomerProfile (corresponding to Parameter)
> 3. Now I need to enable the end users of my tool to further
> decleratively define an expression on the instantiated Parameter
> entity "CustomerProfile"(and not the Parameter
> model entity itself):
> CustomerProfile == "Gold"
> This expression would later be evaluated as a business
> rule and help identify the path in a business
> process workflow to be taken. But for the time being I
> just need a mechanism to help define the expression,
> irrespective of the action that needs to be taken post
> the expression is evaluated.
> So the end user first declaratively creates a model
> instance CustomerProfile and then declaratively defines the
> expression using it. (CustomerProfile == "Gold").
> This leads to the question, would it be possible to define
> constraints at M0 level using OCL decleratively.
> As Edward replies in my earlier post:
> "if(Customer Profile == "Gold"), do this else do that... "
> is not a constraint. It is a procedure, which you may model with an
> operation whose body can be defined using
> @Edward: I hope I am getting this right but how can I
> achieve this, as while defining my domain model (M1) I yet
> dont know what parameters user would create and hence what
> expressions he/she would define using these parameters. Any pointers
> would really be very useful!
> Best Regards,
Powered by FUDForum
. Page generated in 0.09478 seconds