hcOPF - Why DogFooding is Important

A while back, I came across an edge case with hcOPF that I had not anticipated when I wrote the binding mechanism.  When an object has calculated attributes, it forces the attached mediators to update the UI by triggering an ObjectChanged event which calls:

//notify all mediators of the change

which cycles through all mediators forcing them to update their controls.

Normally this isn’t a problem, but if you have outside stimulus that triggers a calculation event, such as a timer, or I/O device, then an update may be triggered while editing the object.  What’s worse, is that if the user is changing an attribute value, and the calculation is triggered before the editor control updates the object attribute (this will happen if the control doesn’t use an OnChange event), then the user’s changes will be overwritten.  It makes for a challenging situation for the user to make a change before the object is changed by the external cause.

What would be more appropriate is that the ThcCalcObject should trigger the UI updates for only the attributes it modifies.  This blog post should serve as a good reminder to both make this enhancement, and continue to use the work that you produce so you can see it through the eyes of a consumer (dogfooding).

One Response to “hcOPF - Why DogFooding is Important”

  1. Andrea Raimondi Says:


    I tried downloading hcOPF but to no avail… where can I find the files?
    What Delphi versions does it support?

    Thank you in advance!


Leave a Reply