Skip to content

2.4.0

Latest

Choose a tag to compare

@Tochemey Tochemey released this 16 Feb 00:12
Immutable release. Only release title and notes can be modified.

๐Ÿš€ What's Changed

โœจ Fluent Message Factory Builder API

  • Code-first configuration without XML โ€” a new MessageFactoryBuilder<T> provides a fluent, type-safe API for constructing fully-configured MessageFactory instances entirely in code.
  • ๐Ÿงฉ Supports all configuration options previously available only through XML: headers, templates, parse maps, custom fields, composite fields, and all factory properties.
  • ๐Ÿ”— Template and parse-map inheritance via Extends(), with field-level override and exclusion support.
  • ๐Ÿ—๏ธ New builder classes: MessageFactoryBuilder<T>, TemplateBuilder, ParseMapBuilder, and CompositeFieldBuilder.
var factory = new MessageFactoryBuilder<IsoMessage>()
    .WithEncoding(Encoding.UTF8)
    .WithHeader(0x0200, "ISO")
    .WithTemplate(0x0200, t => t
        .Field(3, IsoType.NUMERIC, "000000", 6)
        .Field(11, IsoType.NUMERIC, "000001", 6)
        .Field(41, IsoType.ALPHA, "TERMINAL", 8))
    .WithTemplate(0x0210, t => t
        .Extends(0x0200)
        .Field(39, IsoType.ALPHA, "00", 2))
    .WithParseMap(0x0200, p => p
        .Field(3, IsoType.NUMERIC, 6)
        .Field(11, IsoType.NUMERIC, 6)
        .Field(41, IsoType.ALPHA, 8))
    .WithParseMap(0x0210, p => p
        .Extends(0x0200)
        .Field(39, IsoType.ALPHA, 2))
    .Build();

๐Ÿ“Ž PR: #42

โšก Performance: Zero-Copy Parsing, Span<T>, Bitmap128 & Allocation Reductions

  • ๐Ÿงฎ Bitmap128 struct backed by UInt128 replaces BitArray for field-presence tracking โ€” significantly faster bit operations with zero heap allocations.
  • ๐Ÿ”ฌ Span<T> and ReadOnlySpan<T> used throughout parsing and encoding, enabling zero-copy byte/string conversions and eliminating intermediate array allocations.
  • ๐Ÿ”„ Zero-copy byte utilities (Bytes extensions) using MemoryMarshal.Cast for reinterpreting between byte[] and sbyte[] without copying.
  • ๐Ÿงต Stringx extensions with GetSignedBytes() overloads that encode directly into destination buffers, plus ArrayPool<T> pooled variants for hot paths.
  • ๐Ÿ’พ EncodingCache to avoid repeated encoding lookups.
  • ๐Ÿ“ฆ Reorganised internal utilities from NetCore8583.Util โ†’ NetCore8583.Extensions namespace for clearer separation.
  • ๐Ÿ”ง All field parsers, IsoMessage, IsoValue, MessageFactory, and codec classes updated to use the new span-based APIs.

๐Ÿ“Ž PR: #41

โš ๏ธ Breaking Changes

  • The NetCore8583.Util namespace has been reorganised into NetCore8583.Extensions. If you reference types like HexCodec, Bcd, Arrays, OsUtil, Enumm, DictionaryExtensions, or ParseException directly, update your using statements accordingly.
  • ๐Ÿ—‘๏ธ Removed: ByteUtil, DateUtil, StringUtil, DictionaryExtensions, Enumm, and ParseException from NetCore8583.Util (replaced by equivalents in NetCore8583.Extensions).

Full Changelog: 2.3.0...2.4.0