Skip to content

Refactor Timeline Serialization to Use Generic ISerializer<T> #6

@rian-be

Description

@rian-be

Problem

Right now, MessagePackTimelineSerializer is Timeline specific serializer that duplicates MessagePack configuration, options, and ULID handling. This causes:

  • repeated configuration code across serializers
  • inconsistent serialization patterns across domain types
  • harder testing and extending for new types

At same time, ISerializer<T> already provides generic, reusable serializer abstraction with MessagePack support and ULID handling.


Goal

Replace MessagePackTimelineSerializer with generic solution using ISerializer<T>:

  • Use ISerializer<Timeline> as the underlying serializer
  • Make ITimelineSerializer thin adapter delegating to ISerializer<Timeline>
  • Remove duplicate configuration for MessagePack options and ULID formatter

Proposed Tasks

  • Remove current MessagePackTimelineSerializer
  • Implement TimelineSerializerAdapter : ITimelineSerializer that wraps ISerializer<Timeline>
  • Register ISerializer<Timeline> in DI using MessagePackSerializer<Timeline>
  • Update all consumers of ITimelineSerializer to use adapter
  • Verify Timeline serialization/deserialization still works correctly

Benefits

  • Eliminates duplicate serializer configuration
  • Provides single, reusable serialization mechanism for multiple domain types
  • Makes it easier to swap serialization formats (JSON, Protobuf, etc.)
  • Improves testability and maintainability of serialization logic

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions