Interface
caplin.trading.trademodel

TradeLegFactory

The TradeLegFactory class is responsible for creating the correct instance of caplin.trading.trademodel.TradeLeg, based on a given asset class. For example, within the reference implementation, instances of caplin.fx.trademodel.FxTrade are constructed each time a trade leg is needed with an FX asset class.

This factory needs to exist so that functionality within the caplin.trading.trademodel.Trade base class is still able to construct leg instances, even though it can not be sure of the exact leg class to use, it not being aware of the sub-class that has been used to extend caplin.trading.trademodel.Trade.

Constructor Summary

Attributes Name and Description
caplin.trading.trademodel.TradeLegFactory()

Method Summary

Attributes Name and Description
caplin.trading.trademodel.TradeLeg createLeg(String sAssetClass, caplin.trading.trademodel.TradeLeg oTrade, int nLegId)

Creates an instance of a TradeLeg

Constructor Detail

caplin.trading.trademodel.TradeLegFactory()

Method Detail

caplin.trading.trademodel.TradeLeg createLeg(String sAssetClass, caplin.trading.trademodel.TradeLeg oTrade, int nLegId)

Creates an instance of a TradeLeg

Parameters
String sAssetClass The class of the asset traded by leg.
caplin.trading.trademodel.TradeLeg oTrade The trade that the leg is a part of.
int nLegId An identifier for the leg to be created.
Returns
an instance of TradeLeg.