How javanance/gcfg works
Project type and purpose
• This is a backend Java batch‐style application for financial asset valuation under the KICS framework.
• It reads market data and KICS asset records from a relational database, runs interest‐rate scenario models (Nelson‐Siegel, Smith‐Wilson), prices various instruments (bonds, loans, derivatives), and writes valuation results back to the database.
File structure
• Top‐level “src/com/gof” packages map directly to logical layers:
• dao (data access objects using Hibernate)
• entity (JPA‐mapped domain objects)
• enums (domain‐specific enumerations)
• instrument (pricing implementations per instrument type)
• irmodel (IR scenario generators)
• process (Main entrypoints and orchestration)
• util (common utilities: math, file, Hibernate session, logging)
• Configuration files: hibernate.cfg.xml, log4j2.xml under src/ and bin/
• pom.xml for Maven build; secr.properties for secrets
• bin/ and target/ contain compiled classes and property files for runtime.
README for additional insights
• Minimal description: “Asset Valuation under KICS”, version HK_2023, changes for FRN and KTB Forward.
a. Main components:
• External RDBMS (KICS asset tables, interest‐rate curves, reference rates)
• Data Access Layer (com.gof.dao + HibernateUtil)
• Domain Model (JPA Entities in com.gof.entity + com.gof.enums)
• Business Logic Layer:
– IR Model Engines (com.gof.irmodel: Nelson‐Siegel, Smith‐Wilson)
– Instrument Pricing (com.gof.instrument: bonds, loans, derivatives)
– Utilities (com.gof.util: math, RNG, file I/O, logging)
• Orchestration Layer (com.gof.process: Main.java)
• External Tools/Services (optional R integration via RScriptData, file system)
b. Relationships and interactions:
– Main process starts → uses DAO to read entities → passes data to IRModel → generates scenarios → passes scenarios and entities to Instrument classes → calculates valuations → uses DAO to persist results → logs progress via Log4J → optionally invokes R scripts.
– HibernateUtil manages session/transaction to RDBMS.
c. Architectural patterns and principles:
– Layered architecture: Persistence (DAO + Entities), Service/Domain (IR models + instruments + utils), Orchestration (process).
– Use of Dependency Injection via Hibernate configuration (PhysicalNamingStrategy)
– Separation of concerns: each instrument or model implements a common interface.
d. Technologies, frameworks, and libraries:
– Java (JDK 8+), Maven
– Hibernate ORM (hibernate.cfg.xml)
– Log4J2 for logging
– JUnit/Test classes under com.gof.test
– Optional R integration (com.gof.test.RScriptData)