Skip to main content



      Home
Home » Modeling » OCL » OCL fan-in & fan-out
OCL fan-in & fan-out [message #3596] Tue, 06 February 2007 05:51 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:OCL/UML Help
Next Topic:ocl, uml, can't start.
Goto Forum:
  


Current Time: Wed May 07 17:32:20 EDT 2025

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

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

Back to the top