Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use the union operation in ocl

2 views
Skip to first unread message

Niles Ludlum

unread,
Dec 5, 2007, 9:14:04 PM12/5/07
to
I am using Bold with Delphi 7.

I need to merge 2 object lists (from the same class) together in the one ocl
operation. It appears that I can do this using the union operation. However,
all the documentation that I've been able to find is somewhat vague.

Can anyone help with a practical example of some ocl?

Niles


Dmitriy Nagirnyak

unread,
Dec 6, 2007, 3:35:45 AM12/6/07
to
Hello Niles,

> I need to merge 2 object lists (from the same class) together in the
> one ocl operation. It appears that I can do this using the union
> operation.

> Can anyone help with a practical example of some ocl?
>
Try something like this:
self.LeftWheels->union(self.RightWheels)->(self.TruckTrailer.AllTrailerWheels)

I also often apply ->asSet operation at the end to make sure there are no
2 the same wheels :-)

Cheers,
Dmitriy Nagirnyak
http://dcportal.argocomputing.com.au
http://dnagir.blogspot.com


Niles Ludlum

unread,
Dec 6, 2007, 8:43:55 AM12/6/07
to
Dmitriy,

Your example gave me something to compare my interpretation with and thereby
helped identify my error.


Thank you.

Niles

"Niles Ludlum" <n.lu...@gmail.com> wrote in message
news:47575aeb$1...@newsgroups.borland.com...

Dmitriy Nagirnyak

unread,
Dec 6, 2007, 5:18:38 PM12/6/07
to
Hello Niles,

> Your example gave me something to compare my interpretation with and
> thereby helped identify my error.
>

Write a unit test for that :-)

> Thank you.
>
You are welcome.

0 new messages