Cronus Documentation
  • Introduction
  • Getting Started
    • Quick Start
      • Setup
      • Persist First Event
      • Explore Projections
  • Cronus Framework
    • Concepts
      • Domain Driven Design
      • Event Sourcing
      • Command Query Responsibility Segregation
    • Domain Modeling
      • Bounded Context
      • Multitenancy
      • Aggregate
      • Entity
      • Value Object
      • IDs
      • Published Language
      • Messages
        • Commands
        • Events
        • Public Events
        • Signals
      • Handlers
        • Application Services
        • Sagas
        • Projections
        • Ports
        • Triggers
        • Gateways
    • Event Store
      • EventStore Player
      • Migrations
        • Copy EventStore
    • Workflows
    • Indices
    • Jobs
    • Cluster
    • Messaging
      • Serialization
    • Configuration
    • Unit testing
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Cronus Framework
  2. Messaging

Serialization

PreviousMessagingNextConfiguration

Last updated 4 years ago

Was this helpful?

interface is simple. You can plug your own implementation in but should not change it once you are in production.

The samples in this manual work with JSON and Proteus-protobuf serializers. very ICommand, IEvent, ValueObject or anything which is persisted is marked with a DataContractAttribute and the properties are marked with a DataMemberAttribute. . We use Guid for the name of the DataContract because it is unique.

Best Practices

You can/should/must...

  • you must add private parameterless constructor

  • you must initialize all collections in the constructor(s)

  • you can rename any class whenever you like even when you are already in production

  • you can rename any property whenever you like even when you are already in production

  • you can add new properties

You should not...

  • you must not delete a class when already deployed to production

  • you must not remove/change the Name of the DataContractAttribute when already deployed to production

  • you must not remove/change the Order of the DataMemberAttribute when deployed to production. You can change the visibility modifier from public to private

https://github.com/Elders/Cronus/issues/269
ISerializer
Here is a quick sample how this works (just ignore the WCF or replace it with Cronus while reading)