BondSecurity vs. BondSecurityDefinition


#1

Hello,

I’m trying to get familiar with OG-Analytics and I noticed there is a class BondSecurty in

  • com.opengamma.analytics.financial.interestrate.bond.definition;

and a similar class BondSecuityDefinition in

  • com.opengamma.analytics.financial.instrument.bond;

Why are there two similar classes and what are they both used for?

The latter class has not been touched since November 2012, whereas the former was revised in August 2013.

Then there is a third class BondSecurity in

  • com.opengamma.financial.security.bond;

This last one is quite different than the preceding two.

Thank you very much for any help as I try to wrap my head around all this.

Best regards,
Eric

PS: In Matlab (my weapon of choice for 20 years), there is a nice function called “depfun” that traces the dependencies of any function. Is there something similar in Java? For example, I’d like to specify

  • com.opengamma.analytics.financial.interestrate.bond.definition.BondSecurity

and find all classes that depend on this class. That would be super useful.


#2

The first two are the definition-derivative pair within analyics.

com.opengamma.analytics.financial.instrument.bond.BondSecuityDefinition is the definition, which is the high-level descriptive form.

com.opengamma.analytics.financial.interestrate.bond.definition.BondSecurty is the derivative, which is the low-level form, with the valuation time implicitly baked in.

The analytics library takes in definitions and converts them to derivatives before final pricing.

com.opengamma.financial.security.bond.BondSecurity is the representation used in the database.

To find references/dependencies to a class, use a Java IDE. All IDES (Eclipse, IntelliJ, NetBeans) will have some keypress or search that allows you to find references/callers to a class/method.


#3

Thank you Stephen. That is helpful.