You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But where Add() and Remove() are fairly extensive, as they describe the actual logic of interest.
This sub-ish class-ish approach works well enough and it's a relatively consistent pattern across the codebase. However it's a bit tedious to write tests over and over to ensure the delegate is properly wired.
It might be easier to change this relationship into a factory function of some kind. Pass in the Add() and Remove() function bodies and get back a wired-up Stock. This would reduce some of the boilerplate and repetitive testing.
The text was updated successfully, but these errors were encountered:
In Skenario the Stock is a key object; different parts of the simulation are expected to mostly locate their logic in
Add()
andRemove()
.In the current implementation this is achieve with a subclassing-like structure. For example,
ReplicasDesired
:which then uses an internal delegate stock to handle some tasks:
But where
Add()
andRemove()
are fairly extensive, as they describe the actual logic of interest.This sub-ish class-ish approach works well enough and it's a relatively consistent pattern across the codebase. However it's a bit tedious to write tests over and over to ensure the delegate is properly wired.
It might be easier to change this relationship into a factory function of some kind. Pass in the
Add()
andRemove()
function bodies and get back a wired-up Stock. This would reduce some of the boilerplate and repetitive testing.The text was updated successfully, but these errors were encountered: