You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Trustin Lee <tr...@gmail.com> on 2007/11/22 04:24:13 UTC

Cyclic dependencies in mina-statemachine

Hi,

I've just ran JDepends against the current trunk, and it found some
cyclic dependencies:

--------------------------------------------------
- Package Dependency Cycles:
--------------------------------------------------

org.apache.mina.example.tapedeck
    |
    |   org.apache.mina.statemachine.context
    |-> org.apache.mina.statemachine
    |   org.apache.mina.statemachine.transition
    |-> org.apache.mina.statemachine

org.apache.mina.statemachine
    |
    |   org.apache.mina.statemachine.transition
    |-> org.apache.mina.statemachine

org.apache.mina.statemachine.annotation
    |
    |   org.apache.mina.statemachine.event
    |   org.apache.mina.statemachine.context
    |-> org.apache.mina.statemachine
    |   org.apache.mina.statemachine.transition
    |-> org.apache.mina.statemachine

org.apache.mina.statemachine.context
    |
    |-> org.apache.mina.statemachine
    |   org.apache.mina.statemachine.transition
    |-> org.apache.mina.statemachine

org.apache.mina.statemachine.event
    |
    |   org.apache.mina.statemachine.context
    |-> org.apache.mina.statemachine
    |   org.apache.mina.statemachine.transition
    |-> org.apache.mina.statemachine

org.apache.mina.statemachine.transition
    |
    |   org.apache.mina.statemachine
    |-> org.apache.mina.statemachine.transition

I'm not sure we have to fix this because all these classes are pretty
tightly coupled with each other.  What should we do with these
packages?

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: Cyclic dependencies in mina-statemachine

Posted by Niklas Therning <ni...@trillian.se>.
Trustin Lee wrote:
> Hi,
>
> I've just ran JDepends against the current trunk, and it found some
> cyclic dependencies:
>
> --------------------------------------------------
> - Package Dependency Cycles:
> --------------------------------------------------
>
> org.apache.mina.example.tapedeck
>     |
>     |   org.apache.mina.statemachine.context
>     |-> org.apache.mina.statemachine
>     |   org.apache.mina.statemachine.transition
>     |-> org.apache.mina.statemachine
>
> org.apache.mina.statemachine
>     |
>     |   org.apache.mina.statemachine.transition
>     |-> org.apache.mina.statemachine
>
> org.apache.mina.statemachine.annotation
>     |
>     |   org.apache.mina.statemachine.event
>     |   org.apache.mina.statemachine.context
>     |-> org.apache.mina.statemachine
>     |   org.apache.mina.statemachine.transition
>     |-> org.apache.mina.statemachine
>
> org.apache.mina.statemachine.context
>     |
>     |-> org.apache.mina.statemachine
>     |   org.apache.mina.statemachine.transition
>     |-> org.apache.mina.statemachine
>
> org.apache.mina.statemachine.event
>     |
>     |   org.apache.mina.statemachine.context
>     |-> org.apache.mina.statemachine
>     |   org.apache.mina.statemachine.transition
>     |-> org.apache.mina.statemachine
>
> org.apache.mina.statemachine.transition
>     |
>     |   org.apache.mina.statemachine
>     |-> org.apache.mina.statemachine.transition
>
> I'm not sure we have to fix this because all these classes are pretty
> tightly coupled with each other.  What should we do with these
> packages?
>
> Trustin
>   
Hi,

I assume that JDepends uses uses the import statements in the code, 
right? Eclipse will add imports for @link Javadoc tags which is probably 
why you see so many cyclic dependencies.

So what do we do in this case? I would hate to have to write fully 
qualified class names in Javadoc snippets. I would say that JDepends is 
wrong if it only looks at imports. Instead, it should try to figure out 
what the actual code depends on. Please correct me if I'm wrong but when 
looking at the code in o.a.m.sm.content the only reference I find to 
o.a.m.sm.event is in a Javadoc snippet.

/Niklas