Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control FX more effectively (FxRateLookup) #1666

Merged
merged 2 commits into from Mar 22, 2018
Merged

Conversation

jodastephen
Copy link
Member

Move FxRateLookup to strata-calc and extend CakculationParameter
Change CalculationTask to use parameter
Extend CalculationParameters to search parent interfaces

This is a backwards incompatible change, however serialized instances of RatesMarketDataLookup will deserialize fine. Fixing the incompatibility simply requires an organize imports.

Move `FxRateLookup` to strata-calc and extend `CakculationParameter`
Change `CalculationTask` to use parameter
Extend `CalculationParameters` to search parent interfaces
Copy link
Contributor

@cjkent cjkent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor things

CalculationParameter.class.isAssignableFrom(iface) &&
!parameters.containsKey(iface)) {

aliases.put(iface.asSubclass(CalculationParameter.class), type);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail if there are two values in parameters of different classes that both implement the same interface that is a subtype of CalculationParameter. It's ambiguous which one should be used so it should probably fail, but it might be nice to provide some explanation.

}

private LookupScenarioFxRateProvider(ScenarioMarketData marketData, FxRateLookup lookup) {
this.marketData = marketData;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null checks

@jodastephen jodastephen merged commit 8cb837a into master Mar 22, 2018
@jodastephen jodastephen deleted the topic/fx-lookup branch March 22, 2018 12:06
jodastephen added a commit that referenced this pull request Mar 22, 2018
* Control FX more effectively

Move `FxRateLookup` to strata-calc and extend `CakculationParameter`
Change `CalculationTask` to use parameter
Extend `CalculationParameters` to search parent interfaces

* Update from PR
@jodastephen jodastephen added this to the v1.8 milestone Apr 9, 2018
@jodastephen jodastephen modified the milestones: v1.8, v2.0 Jun 12, 2018
@jodastephen jodastephen changed the title Control FX more effectively Control FX more effectively (FxRateLookup) Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants