Project V: Connections
Tuesday, 4. December 2007, 02:39:18
My mind's toast today. Another obstacle in my way is how connections works together with inheritance. Say I have A with Inputs {X,Y,Z} and Ouputs {X,Y,Z}. Say I also have B with the same inputs and outputs (same name, different instances). Then I want to link A.Ouputs.Y to B.Inputs.X. How would I do that considering that I can derive A and B? I'm thinking of using names instead of directly linking like I am now. It'll be slower, but I think it'll work much better. So I would have quads like this: {"A","Y","B","X"} referencing them by name. The fist two always reference the output and the last two always reference the input. Then I'd look these up in my list of internal components. The only problem I have is that if I delete A,B,Y or X, the connection won't be updated to reflect the fact that they no longer exist. So I have to figure out a way to update them. I think I'll have a backlink to the connection. And recheck the connection upon deletion.
Oh, even better. I can leave it as is and ADD the quad. That way, I can tell when there are no more links to the connection. Brilliant! I'll just change the access methods to get the source and destination.
If anyone understands this warped description and knows of a better way, drop me an email. Anyways, it's strange how when you write it out, things seem to solve themselves. I guess I could implement the above. But I need to change the code for connections. I should always write things out. Why is this not a more common technique for programming? It may go a long to explain why I still use pen and paper to work things out.
I think this is the last part before I write up the execution engine. The runtime version of components is done. This next part will have to wait for tomorrow though. There are some days, concentration just doesn't want to ramp up.
Oh, even better. I can leave it as is and ADD the quad. That way, I can tell when there are no more links to the connection. Brilliant! I'll just change the access methods to get the source and destination.
If anyone understands this warped description and knows of a better way, drop me an email. Anyways, it's strange how when you write it out, things seem to solve themselves. I guess I could implement the above. But I need to change the code for connections. I should always write things out. Why is this not a more common technique for programming? It may go a long to explain why I still use pen and paper to work things out.
I think this is the last part before I write up the execution engine. The runtime version of components is done. This next part will have to wait for tomorrow though. There are some days, concentration just doesn't want to ramp up.