# quickfix-j/quickfixj architecture

> Architecture diagram of the GitHub repository quickfix-j/quickfixj, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quickfix-j/quickfixj
- Repository: https://github.com/quickfix-j/quickfixj

## Overview

##### Main Components

a. Core Components:
- Message Engine (quickfixj-core)
- Message Definitions (quickfixj-messages)
- Session Management
- Message Store
- Message Factory
- Logging System

b. External Interfaces:
- Socket Acceptor/Initiator
- FIX Protocol Endpoints
- Application Interface

##### Application Layer
- Custom Applications (implementing Application interface)
- Message Crackers
- Event Handlers

##### Session Layer
- Session Management
- Connection Handling
- Message Validation

##### Message Layer
- Message Parsing/Generation
- Field Management
- Data Dictionary

##### Storage Layer
- Message Store
- Logging
- State Management

##### Component Relationships

- Message flow between components
- Inheritance relationships
- Dependencies between modules
- Event propagation paths

##### Design Elements

Use these visual elements:
- Blue: Core components
- Green: External interfaces
- Yellow: Storage components
- Gray: Supporting utilities

- Rectangles: Major components
- Rounded rectangles: Interfaces

##### Specific Implementation Details

Classes:
- SocketAcceptor/SocketInitiator
- Session
- MessageStore
- MessageFactory
- Application interface
- MessageCracker

##### Integration Points

Show:
- FIX protocol version support (4.0-5.0SP2/FIXT1.1)
- External system connections
- Configuration points
- Logging interfaces

##### Extension points for customization

Example structure:
**[External Systems]**
- ↕
**[Socket Layer (Acceptor/Initiator)]**
- ↕
**[Session Management]**
- ↕
**[Message Processing]**
- ↙   ↓   ↘
**[Store][Log][Application]**

- Component types
- Version support

This will provide a clear visualization of QuickFIX/J's architecture while maintaining the necessary detail level for a principal software engineer to understand the system's structure and behavior.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef core fill:#b3d1ff,stroke:#333
    classDef interface fill:#98fb98,stroke:#333
    classDef storage fill:#ffeb99,stroke:#333
    classDef utility fill:#d3d3d3,stroke:#333

    %% External Systems Layer
    subgraph ExternalLayer["External Systems Layer"]
        ExternalFIX["External FIX Systems"]
    end

    %% Application Layer
    subgraph AppLayer["Application Layer"]
        CustomApp["Custom Applications"]:::interface
        AppInterface["Application Interface"]:::interface
        MessageCracker["Message Cracker"]:::core
    end

    %% Session Layer
    subgraph SessionLayer["Session Layer"]
        SocketAcceptor["Socket Acceptor"]:::core
        SocketInitiator["Socket Initiator"]:::core
        SessionMgmt["Session Management"]:::core
        SessionSettings["Session Settings"]:::core
    end

    %% Message Layer
    subgraph MessageLayer["Message Layer"]
        MessageEngine["Message Engine"]:::core
        MessageFactory["Message Factory"]:::core
        MessageDefs["Message Definitions"]:::core
        DataDict["Data Dictionary"]:::core
    end

    %% Storage Layer
    subgraph StorageLayer["Storage Layer"]
        subgraph MessageStore["Message Store"]
            FileStore["File Store"]:::storage
            MemStore["Memory Store"]:::storage
            JdbcStore["JDBC Store"]:::storage
        end
        
        subgraph LoggingSystem["Logging System"]
            FileLog["File Log"]:::storage
            ScreenLog["Screen Log"]:::storage
            JdbcLog["JDBC Log"]:::storage
        end
    end

    %% Relationships
    ExternalFIX <--> SocketAcceptor & SocketInitiator
    SocketAcceptor & SocketInitiator --> SessionMgmt
    SessionMgmt --> MessageEngine
    MessageEngine --> MessageFactory
    MessageFactory --> MessageDefs
    MessageEngine --> DataDict
    MessageEngine --> CustomApp
    CustomApp --> AppInterface
    AppInterface --> MessageCracker
    SessionMgmt --> SessionSettings
    MessageEngine --> MessageStore
    MessageEngine --> LoggingSystem

    %% Click events
    click MessageEngine "https://github.com/quickfix-j/quickfixj/tree/master/quickfixj-core/"
    click MessageDefs "https://github.com/quickfix-j/quickfixj/tree/master/quickfixj-messages/"
    click SessionMgmt "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/Session.java"
    click FileStore "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/FileStore.java"
    click MemStore "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/MemoryStore.java"
    click JdbcStore "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/JdbcStore.java"
    click MessageFactory "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/MessageFactory.java"
    click FileLog "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/FileLog.java"
    click ScreenLog "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/ScreenLog.java"
    click JdbcLog "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/JdbcLog.java"
    click SocketAcceptor "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/SocketAcceptor.java"
    click SocketInitiator "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/SocketInitiator.java"
    click AppInterface "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/Application.java"
    click MessageCracker "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/MessageCracker.java"
    click DataDict "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-base/src/main/java/quickfix/DataDictionary.java"
    click SessionSettings "https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/quickfix/SessionSettings.java"
```
