Git Product home page Git Product logo

Comments (7)

frankdejonge avatar frankdejonge commented on May 27, 2024 2

@dmecke "the worst thing ever" is a bit of an over statement. But in general deferred command handling doesn't reflect what's actually going on. Actions should always happen when dispatched and events can be handled later. This means we can more accurately model what's going on when we dispatch the command, which only results in an event that this was initiated/requested. The actual processing of said request would then be done in a process manager. Modelling is like this ensures the program behaves predictably and changes to the behaviour don't result in fragmented handling. For instance: what if a request also need to process an uploaded file? Now you deferred command need to either contain the file in a serialized way or some kind of middleware needs to be introduced in order to extract and re-attach the file. This introduces needless accidental complexity and makes it harder to see what is actually happening. All in all, it comes down to personal taste. I don't like it and won't use it because I find it harder to wrap my mind around.

from eventsauce.

marijn avatar marijn commented on May 27, 2024

Why not? I do this often to create a command log which can also be interesting for doing some command sourcing for testing.

from eventsauce.

frankdejonge avatar frankdejonge commented on May 27, 2024

If we have non-destructive code-gen, people can do this for themselves. Initially the idea was deferred command handling, which I then realized was the worst thing ever. But it does make sense from a logging perspective. But the fact that we don't have a command interface is beneficial because it doesn't conflict with anything either.

from eventsauce.

frankdejonge avatar frankdejonge commented on May 27, 2024

Perhaps having a default implementation of JsonSerializable would be good?

from eventsauce.

dmecke avatar dmecke commented on May 27, 2024

Why is deferred command handling so bad? I rely heavily on it and it causes no problems so far, but now I am a bit worried.

from eventsauce.

dmecke avatar dmecke commented on May 27, 2024

Thank you very much for the explanation!

from eventsauce.

frankdejonge avatar frankdejonge commented on May 27, 2024

This was implemented in the last version. Tracing and logging are nice use-cases for this. It's implemented as an optional "opt-in" feature in the CodeGen section.

from eventsauce.

Related Issues (20)

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.