Note that there are some explanatory texts on larger screens.

plurals
  1. USMartin Bliss
    primarykey
    data
    text
    plurals
    1. COI wouldn't say it can't be done, as you just laid out exactly what needs to happen for it to work. The solution is to create a base class that holds only the most basic required information, with an abstract method to "do the work". Each sub-class overrides this method, knowing exactly how to do what needs to be done. The thread then only calls the Do Work method and washes its hands of the rest. This involves tweaking my design just a little but this allows me to keep the threading and single queue idea.
      singulars
    2. COI should also add that I have Repository layer for persisting objects in the database, but that doesn't absolve me from the fact that - in memory - objects are put in a dirty state, and I need to be able to "revert back" when the user hits cancel while editing one of those objects. I don't see any other way around the need for copying objects.
      singulars
    3. COClass A has functions that many other classes (Class B, C, and D for example) need access to. Class A has public functions (unrelated to the delegate) that are designed to be called in a sequence, thus I don't want to expose Class A to other classes unfamiliar with the sequence, allowing for confusion or worse. The alternative is to pass an object from Class A to other classes containing delegates so as to avoid exposing Class A directly to mischief.
      singulars
 

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