Skip to content

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Financial Management System

A Java modeling tool for investment portfolios. It builds a small object model of people, brokers, assets and portfolios, loads that data from either flat files or a MySQL database, and produces formatted summary and detail reports — total value, weighted risk, projected return, broker fees and commissions per portfolio.

What it models

  • PeoplePerson, with Broker (abstract) split into JuniorBroker and ExpertBroker, each with its own fee and commission schedule (e.g. junior brokers charge a flat $75/asset plus 1.25% commission; expert brokers charge no flat fee but 3.75% commission).
  • AssetsAsset (abstract) implemented as Stock, Deposit, and PrivateInvestment, each computing its own value, annual return, and risk measure.
  • Portfolios — a Portfolio ties an owner, a manager, an optional beneficiary, and a list of assets together, and aggregates their totals.
  • A hand-rolled generic MyLinkedList<T> (with its own iterator) is used to hold and sort portfolio collections, rather than relying on java.util.

Three entry points

ClassData sourceWhat it does
PortfolioFileReportFlat files in data/Loads portfolios from the .dat files and prints a summary + detail report. No setup required — this is the quickest way to see it run.
PortfolioReportMySQLLoads the same data from a database via JDBC and prints three summary reports sorted by owner, value, and manager.
DataConverterFlat files in data/Converts the asset and person data into XML (via XStream) and JSON (via Gson).

Data format

Persons.dat and Assets.dat are semicolon-delimited flat files, one record per line, e.g.:

LU02704JUO6JDTTL4CI5;S;Ailane;2.92;7.56;0.83;THM;209.19

Portfolios.dat references records from both by code. All sample data under TBFassignment/data/ is synthetically generated — no real people or accounts.

Running it

The project has no build tool (Maven/Gradle) — it's a plain javac/IntelliJ project. Third-party jars (gson, xstream, mysql-connector-java, xmlpull) are vendored under TBFassignment/lib/.

Easiest path — open in IntelliJ: open TBFassignment/, let it pick up Phase1.iml, and run PortfolioFileReport (no external services needed).

From the command line, from TBFassignment/:

mkdir -p out
javac -d out -cp "lib/*" src/com/tbf/*.java
java -cp "out;lib/*" com.tbf.PortfolioFileReport

(Classpath entries are separated by ; on Windows and : on macOS/Linux.)

Running PortfolioReport (the database-backed report) additionally requires a MySQL instance matching the schema in portfolioDB.sql, with connection details supplied via the FMS_DB_URL, FMS_DB_USER, and FMS_DB_PASSWORD environment variables (see DatabaseInfo).

License

MIT

About

Java OOP portfolio modeling tool — brokers, assets, and portfolios loaded from flat files or MySQL, with formatted risk/return/fee reports

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages