Giter Club home page Giter Club logo

fixinator's People

Stargazers

 avatar

Watchers

 avatar  avatar

fixinator's Issues

Consider refactoring the litany of try/catch blocks

Since a FIX engine is meant to extract as much performance as it can (...from javascript here, ha), consider refactoring try/catch blocks to a simple #validate call or #isValid check. This conflicts with #1 in that that issue considers whether or not to remove validation in favor of throwing exceptions.

Refactor all fields such that the user need not call #validate explicitly

Currently, fields are constructed without throwing errors. The user calls #validate on each object and catches errors at validation time. Consider refactoring such that fields are validated on construction, and errors are thrown immediately rather than waiting for an explicit #validate call.

This would force users to handle construction-time throws, but I believe this is more intuitive than a silent #new followed by an explicit #validate call.

Support database storage

Include an optional DB feature to store messages (both sent and received). MongoDB would make plenty of sense here. Perhaps the inclusion of clients or users would be helpful, too.

Return errors list rather than boolean for #validate pattern

The engine is leveraging a #validate pattern to verify and validate all fields, messages, builders, etc. Rather than simply returning true/false (boolean), consider building up a list of errors and returning this list instead.

Motivation:

With a true/false approach, the first error will short-circuit the validation logic and only notify the user that an error occurred. By correcting issues one-by-one, multiple attempts could potentially be required to correct any issues. By building a list of errors, all problems will be surfaced at once. This would improve logging/database activity and also provide the user (including remote FIX engines) with more useful information the first time a validation error occurs.

Support FIX CheckSum

A FIX engine must support the use of checksums to verify all messages:

  • The message sender must calculate the checksum against the final, possibly encrypted, message prior to being sent
  • The message parser must verify the checksum against the received message

Stop changing how "enum" types are implemented - pick a method and settle.

Some FIX fields employ and quasi-enum type wherein a typical FIX Int or FIX Char is constrained to a list of acceptable values. I have changed how these are represented many times and need to settle.

My favorite (not yet fully implemented) method is to build an object with string keys and string values. The string keys will be constrained with a string union type.

Example:

export type ConstrainedKeyValueMap<U extends string> = { [K in U]: string; };

export type TestTypes = 'test1' | 'test2' | 'test3';

// The only acceptable keys are defined in the TestTypes union
export const TEST_TYPES: ConstrainedKeyValueMap<TestTypes> = {
    test1: 't1',
    test2: 'this is the value for test2 type'
    test3: '3'
}

Add encryption/decryption

A FIX engine must support various encryption/decryption methods. This engine has not yet implemented any cryptography. Further, care must be taken regarding which fields can/should be encrypted in the first place.

While developing cryptographic functionality, ensure it it seamlessly integrated into message construction (both sending and parsing).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.