[Ktechlab-devel] Pin and wire.

Alan Grimes agrimes at speakeasy.net
Sat Nov 14 19:44:46 UTC 2009


Wire has matured into a fairly elegant, and easy to use class. It does
only what it needs to, is just about the right size, and can be used in
a fairly wide number of circumstances from bus splitters to switches.

Pin is almost at that point except for one thing. It contains two sets
for containing itself. This is clear evidence of a design problem. It
mixes a thing with an alorithm that operates on the thing. What is
basically happening is that the circuit partitioning algorithm relies
heavily on information stored within the pin.

See CircuitDocument::getPartition and CircuitDocument::recursivePinAdd
for the real uglyness..

Basically what is happening is Component is stuffing information about
circuit topology into the pins where it can be re-constructed in
circuitDocument in order to construct a simulator for that circuit. This
bloats out class Pin and makes the structure of the program less obvious.

Hopefully further analysis of the class interractions can help re-route
this dataflow so that Pin can be as simple as it should be and only
concern itself with what it absolutely needs to.

-- 
DO NOT USE OBAMACARE.
DO NOT BUY OBAMACARE.
Powers are not rights.





More information about the Ktechlab-devel mailing list