This is a purely design question.
I want to port a nice educational "game" Bug Brain to Java. In this game you design neural networks which consist of three elements: neurons, nodes and synapses. Neuron is used to perform some kind of processing on its input signals to produce the desired output; it can be connected with other neurons/nodes (connections are uni-directional and weighted). We can think about nodes can as of junctions - they can also be connected with other neurons/nodes (and these connections are also uni-directional and weighted), but the weight of we cannot change weights of input connections. Synapse is a connection between these two elements. To sum up: neurons and nodes have both inputs and outputs (to other neurons/nodes) and they do some inputs->outputs processing.
Q: Now, how would you design this class structure? This is a sketch I "produced" so far: screenshot of the design
Because the operation "connect two joins (i.e. neuron/node)" has three responsibilities (add synapse, add output to join A, add input to join B) I've decided to put it as a static methid in a controller class. Of course I could avoid such two-directional relationships between elements: I don't have to keep track of outputs, only inputs but there are some other limitations eg. there can be only 8 I/Os per join so then I'd have to iterate over all synapses every time I add a connection to see if there is still some place to add it. In this case (this game) you won't have too many connections so it would not hit performance, but I'd like to know how to deal with such situations in general.
As it's the foundation of this whole logic of this project I'd like to have it properly made. All suggestions are warmly welcome ;)