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
What I would have expected is that it worked something like this pseudo-csharp:
// Build route transform usage information based on validation
var routeTransforms = routes
.SelectMany((route) => route.Transforms
.Select(transform => transformFactories
.Where(factory => factory.Validate(new(route), transform.Values))
.Select(factory => (route, factory, transform.Values))
)
);
// Build route transforms
routeTransforms.ForEach((route, factory, values) => factory.Build(new(route), values));
However instead the same progressive iteration is used for both Validate and Build. Which means that Build is called a lot with data that's not valid. Which means that each Build implementation has to reimplement the entirety of the Validate method. Which means that Validate might as well not be implemented and just return true.
Why is this so weird? Or do I fundamentally misunderstand something about how to use the transform factories?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What I would have expected is that it worked something like this pseudo-csharp:
However instead the same progressive iteration is used for both
Validate
andBuild
. Which means thatBuild
is called a lot with data that's not valid. Which means that eachBuild
implementation has to reimplement the entirety of theValidate
method. Which means thatValidate
might as well not be implemented and just returntrue
.Why is this so weird? Or do I fundamentally misunderstand something about how to use the transform factories?
Beta Was this translation helpful? Give feedback.
All reactions