Skip to main content



      Home
Home » Modeling » OCL » a derived property(how can we duplicate the content of a class (even its associations and composition))
a derived property [message #1798548] Tue, 20 November 2018 05:43 Go to next message
Eclipse UserFriend
how can we duplicate the content of a class (even its associations and composition) rather than copiying the original elements

I want to create an instance of message class from its containing port where each message is formed by a set of parameters

I'm using OCLinEcore (a metamodel)
thanks in advance
Re: a derived property [message #1798554 is a reply to message #1798548] Tue, 20 November 2018 07:02 Go to previous messageGo to next message
Eclipse UserFriend
H

I'm confused. You first duplicate classes then instances.

Class duplication is often avoided by using inheritance.

Instance duplication is hard to avoid since it is usually exactly what is necessary. Instantiation is a deliberate duplication wrt the creation protocol.

Regards

Ed Willink
Re: a derived property [message #1798666 is a reply to message #1798554] Thu, 22 November 2018 07:34 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
thanks
but what I want is to have a copy of the object when instanciating the class but being able to define defferent values for the attributes
Re: a derived property [message #1798678 is a reply to message #1798666] Thu, 22 November 2018 10:40 Go to previous messageGo to next message
Eclipse UserFriend
Hi

I'm totally confused.

This is the OCL forum. OCL by itself is useless since it cannot access let alone create or modify a model.

You suggest that you are using OCLinEcore, but tghe OCL in ECore cannot create or modify, so perhaps you are using Ecore so what is wrong with EcoreUtil.copy followed by a set ZXXX() or two.

The Pivot OCL prototypes an ability to create shadow objects and you can assign properties arbitrarily during construction, but I doubt that is what you want.

I suggest you actually make clear what you want rather than assuming that we understand your hints.

Regards

Ed Willink
Re: a derived property [message #1798711 is a reply to message #1798678] Fri, 23 November 2018 01:00 Go to previous messageGo to next message
Eclipse UserFriend
thanks,

What I want is as follows
if I have a class 1 (meta model) having a set of and messages (ordered composes) property to my class
I want to have a class1 byt being modifiable without altering the values of the original objects
that means I creat a new class 2 with property ports PortClass {derivation: self.source.ports as collection (only meaning))
when instanciating the model, I get instances of the class 1 but if I change the value, it wont work, it changes the values of the source also
Re: a derived property [message #1798720 is a reply to message #1798711] Fri, 23 November 2018 03:58 Go to previous messageGo to next message
Eclipse UserFriend
Hi

You ignore my comment and perpetuate the ping-pong. See https://wiki.eclipse.org/OCL/ForumNetiquette

In particular who/what creates/modifies/instantiates and how?

And of course, without an example, what do you mean by a message? In OCL, message support means the horrible syntax kludge to support UML send/receive messages pre/post-conditions.

Regards

Ed Willink
Re: a derived property [message #1799005 is a reply to message #1798720] Wed, 28 November 2018 10:04 Go to previous message
Eclipse UserFriend
Ed Willink, thanks
Previous Topic:Map type support in OCL?
Next Topic:Fail to correctly parse CompleteOCL constraints
Goto Forum:
  


Current Time: Sun Aug 31 07:19:08 EDT 2025

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

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

Back to the top