Code Monkey home page Code Monkey logo

Comments (8)

dadhi avatar dadhi commented on August 23, 2024 1

Ok, to this moment I have implemented MediatR ideas, but stripped to the core, to reveal the whole simplicity of it..

Now, after reading Jeremy's take on this I was thinking how to replace an ad-hoc middleware idea with more DI controllable way. And the answer is.. tadah.. Decorator. Middleware is just a special case of decorating the target handler. Then why don't just use a DryIoc decorators explicitly. The main benefit in addition to abstraction cut, would be controlling the order. I can just insert dercorator closer to handler, if I want. Then I have a decorator's condition, reuse, stateless implementation via factory methods, etc. etc.

from dryioc.

dadhi avatar dadhi commented on August 23, 2024

*gnoring dislikes..

An improved model for messages may look like this:

interface IMessage<TRequest, TResponse> 
   where TResponse : U<NoResponse, Unit, IResponse<TRequest>> {}

Hmm.. ;-)

from dryioc.

dzmitry-lahoda avatar dzmitry-lahoda commented on August 23, 2024

Is it possible to get only some plumbing in DI and retain some implementation in example? I am afraid there should be tests from different domains (enterprise ui, server, desktop console, mobile, games, web sites, value in multi language micro service design) to ensure that messages are good.

May be some code which makes replacing internals of MediatR and other eventing(other case) items with DI easy one step process?

from dryioc.

dadhi avatar dadhi commented on August 23, 2024

@dzmitry-lahoda,

Is it possible to get only some plumbing in DI and retain some implementation in example?

My example above was a bit of a joke :) I will be doing the simplest thing possible, so no pressing of Discriminated Unions. It also will be layers of abstraction as discussed in PR, so you can peek your thing.

from dryioc.

dzmitry-lahoda avatar dzmitry-lahoda commented on August 23, 2024

efdd045#diff-ecb85472b95ba475d6a564e8951d8baeR10461

from dryioc.

dzmitry-lahoda avatar dzmitry-lahoda commented on August 23, 2024

May be add this as md file in documentation instead of releasing? I recall when Unity had mediator as sample in the book or as contrib project. Events are complex beasts with many possibilities regarding threading, order, resource usage, broadcasting, error handling, integration with event loops. So it looks that simplest approach may work in specific set, so experimental namespace would also work.

from dryioc.

dadhi avatar dadhi commented on August 23, 2024

I still release it in separate namespace. Easy to point someone to it. Documentation PR is welcome.

from dryioc.

dadhi avatar dadhi commented on August 23, 2024

Namespace DryIoc.Messages contains this thingy

from dryioc.

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.