Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm sure you will go with an OO package, but don't expect miracles. Here's why.</p> <p>I assume you start out with some application data, a set of application objects, let's call them objects A.</p> <p>You could use a package of OO graphical objects to represent the graphical view of objects A, call this new set of objects G.</p> <p>Now you have two sets of objects, A and G, either one of which could change dynamically, and you are faced with the problem of keeping them in correct correspondence. Not only do you have to generate G from A, you have to modify G when A changes, and modify A when G changes. This calls for lots of event-driven linkage code, and you can never be sure you've handled every case correctly. You can easily get into situations where what you see is <em>not</em> what you get. (WYSINWYG)</p> <p>I have two suggestions:</p> <ul> <li>What you're doing</li> </ul> <p>Have a "paint" routine that directly renders objects A (using "blt" if you want to avoid flashing). Attach simple graphical information to objects A, like screen position and size. Handle mouse events yourself, for highlighting, dragging, creating wires, etc. This may seem like a lot of trouble, but it avoids all the linkage trouble you get into with redundant sets of objects. And, you have complete control of the code.</p> <ul> <li>An oddball method that I use: <a href="https://stackoverflow.com/questions/371898/how-does-differential-execution-work">Differential Execution</a></li> </ul> <p>This is a general technique for managing redundant sets of objects. However, it has a tough learning curve. Most programmers are not up to it, but it does reduce code and guarantee correctness.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload