Hi, I have some questions about high level programming strategies which have been bothering me for some time.
I'm interested in writing tools for technical design, such as vector drawing, mechanical, ee, etc. My first attempt is just a wxpython program that allows you to draw circles, boxes, etc. Of course this has been done a million times, but I want this as an exercise, and to see if I can do it "my" way.
However I keep coming across a few separate but related issues.
1. Constraints in user's data. Line A needs to be 30 degrees from line B, regardless of line B's rotation. A great commercial app that I know of that does this excellently is Solidworks. Other useful examples could be circuit design, text layout, or physical-declarative programming systems such as verilog-a or dymola, which generate equations and turn the "arrows" the correct way when needed.
2. Constraints in the application itself and its usability. The zoom window's extents must not cross the boundaries of the viewable portion, but also still allow you to control the zoom level by panning, drawing a new boundary box, or changing the zoom factor, and it must also maintain the same aspect ratio as the viewing window, with "push back" from the constraint system when something cannot be done, or when something other than what you're directly manipulating needs changing to maintain the relationship.
3. Sharing of parameters and propagation of intention from the user. For instance, if I have a modeless dialog open with grid options, and I change the grid from the dialog, the grid on the display should immediately change. However I should also be able to go to the display itself, issue whatever hot key to change the grid, and the value in the dialog should immediately change. In other words, a parameter changed from one part of the program should immediately be seen in other parts of the program, even inside open dialogs. This would also apply to pan/zoom where there are many places to manipulate this: boundary box, scroll wheel, right mouse click, zoom slider, strokes/gestures, etc. I believe this is called the observer pattern, but I'm not sure.
Most of the technical design programs I've used (ee, mechanical, illustrator/photo, TeX [ha!]), fail to provide the knobs and buttons to make it feel realtime and interactive, which is my ultimate goal here.
I read the degrees/fahrenheit constraints example in SICP and it made sense, but i'm not sure if this approach is overkill for what I want to do above, or perhaps underkill and I need more reading in constraints-based programming.
A google on constraints led me to some big commercial thing with a compiler and its own language, which is not what I want.
Any suggestions or guidance here please?
thank you
Michael