Solution (source code)

= Solution

The <Observer pattern> participants are:

* `Service`: the subject abstraction, owning the current value and registered `Company` references, and providing registration and notification operations.
* `SomeService`: the concrete subject, making `updateValue` notify after establishing the new subject state.
* `Company`: the observer <object interface>, declaring the `meth()` callback.
* `PrivateCompany` and `PublicCompany`, together with the extension `NonProfit`: concrete observers, registering themselves, retaining their subject, and updating their own values on notification.

The printed `PrivateCompany` starts with factor $1$ but uses factor $1.1$ in its callback; `PublicCompany` starts with factor $0.8$ but later uses $0.9$. These are the actual source behaviors, not a uniform pricing rule inferred from their names. The subject stores a <list> and prepends new subscriptions, so notification occurs in reverse registration order. \b[Dependence on the `Company` interface lets the subject notify new observer types without naming their concrete classes.] The omitted `...` portions in the printed figure do not prevent identifying these roles or implementing the added observer.