Skip to content

ZairBulos/data-oriented-programming-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data-Oriented Programming in Java

This project demonstrates Data-Oriented Programming (DOP) principles applied in Java 21.
It processes log files, extracts statistics, and generates a report.

Project Structure

  • LogReader / FileReader
    Reads log files from disk and returns raw lines.

  • LogParser / DefaultLogParser
    Parses each log line into a structured LogEvent (Error, Warn, Info, Debug).

  • LogProcessor
    Coordinates reading and parsing across multiple files, using virtual threads for concurrency.

  • LogStats
    Aggregates statistics from a list of LogEvent objects (counts of errors, warnings, infos, debugs).

  • ReportGenerator
    Produces a human-readable report string with the statistics.

  • ConsoleWriter
    Prints the report to the console.

  • Main
    Entry point: loads log files from resources/logs, processes them, generates statistics, and prints the report.

Example Flow

  1. Load log file paths from src/main/resources/logs.
  2. Process files into LogEvent objects.
  3. Generate statistics (LogStats).
  4. Build a report (ReportGenerator).
  5. Print to console (ConsoleWriter).

About

Log processing with Data-Oriented Programming in Java

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages