OCL fan-in & fan-out [message #3596] |
Tue, 06 February 2007 05:51  |
Eclipse User |
|
|
|
Hello everyone,
I am using the EMFT Query framework to check OCL queries against instance
models. However, I'm new to OCL and I can't seem to find any good
tutorials.
So, I have a instance model which is composed by objects that extend
either "Component" or "Connector" (more specifically, a MVC architecture
editor). What I would like to do is calculate the fan-in/fan-out of a
given component. By fan-in and fan-out I mean counting the number of
connectors pointing to a component (fan-in), and the number of connectors
leaving a component (fan-out).
I'd appreciate any kind of help or advise.
Thanks in advance,
Joana Trindade
|
|
|
Re: OCL fan-in & fan-out [message #4868 is a reply to message #3596] |
Mon, 12 February 2007 05:54  |
Eclipse User |
|
|
|
Anyway, I've managed to do it. With a component selected at the diagram:
-- fan-in
Connector.allInstances()->select(c : Connector | c.target.name =
self.name)->size()
-- fan-out
Connector.allInstances()->select(c : Connector | c.source.name =
self.name)->size()
Cheers,
Joana M. F. Trindade
|
|
|
Powered by
FUDForum. Page generated in 0.04097 seconds