GithubHelp home page GithubHelp logo

stoveproject / stove Goto Github PK

View Code? Open in Web Editor NEW
161.0 25.0 37.0 15.79 MB

Domain Driven Design oriented application framework, meets CRUD needs

License: MIT License

C# 99.50% PowerShell 0.39% PLpgSQL 0.12%
framework ddd domain-driven-design entity-framework redis rabbitmq dapper hangfire nlog nhibernate

stove's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stove's Issues

Package Updates

  • Autofac --> 4.6.1
  • Autofac.Extras.IocManager --> 3.1.2
  • Autofac.Extras.IocManager.DynamicProxy --> 3.1.2
  • StackExchange.Redis --> 1.2.5
  • EntityFramework.DynamicFilters --> 2.9.1

Consider remove EventSource object from IEventData

If we push events to RabbitMq or other messaging systems, EventSource won't be deserialized properly or getting exception since it is a proxied object. Event publisher already knows that where the Event published and why. Thus we can remove it.

Packages Update

  • Newtonsoft.Json 10.0.3
  • Hangfire 1.6.14
  • HangfireSqlServer 1.6.14
  • Hangfire.Core 1.6.14
  • NLog 4.4.11

Implement Stove.NHibernate

  • Should work with Stove.Dapper under same NH transaction

  • Stove.Dapper be able to share NHibernate transaction and policies, commit, rollback etc...

Domain event handlers are fired multiple times in case of registering multiple handlers for the same domain event.

test case like following

 public class EventHandlerTests  
    {
        [Fact]
        public void should_work()
        {
            var resolver = IocBuilder.New.UseAutofacContainerBuilder()
                .UseStoveWithNullables(typeof(FakeBootstrapper)).UseStoveEventBus()
                .RegisterServices(s =>
                {
                    s.RegisterType<FakeBootstrapper>();
                    s.RegisterType<FakeSendToImageProcessorEventHandler>();
                    s.RegisterType<FakeVisualMappingCompletedEventHandler>();
                })
                .CreateResolver();


            var eventBus = resolver.Resolve<IEventBus>();

            eventBus.Register(typeof(VisualMappingCompletedEvent), new IocHandlerFactory(resolver, typeof(FakeSendToImageProcessorEventHandler)));

            eventBus.Register(typeof(VisualMappingCompletedEvent), new IocHandlerFactory(resolver, typeof(FakeVisualMappingCompletedEventHandler)));

            eventBus.Publish<VisualMappingCompletedEvent>(new VisualMappingCompletedEvent(), new Headers());
        }
    }


    public class FakeSendToImageProcessorEventHandler : EventHandlerBase, IEventHandler<VisualMappingCompletedEvent>, ITransientDependency
    {
        static int a ;
        public void Handle(VisualMappingCompletedEvent @event, Headers headers)
        {
            a++;
        }
    }

    public class FakeVisualMappingCompletedEventHandler : EventHandlerBase, IEventHandler<VisualMappingCompletedEvent>, ITransientDependency
    {
        static int b;
        public void Handle(VisualMappingCompletedEvent @event, Headers headers)
        {
            b++;
        }
    }

    public class FakeBootstrapper : StoveBootstrapper
    {

    }

In this case you will see a = 2, b = 2

Dapper

Hi,

thanks for your project, i have a question about dapper.
how to use the dapper in your framework.

thanks!

Multiple mapping with Dapper

Hello @osoykan,

I have yet another impedance mismatch problem :).

It can be nice to have multi-mapping feature of Dapper. What do you think implementing this feature to Stove.Dapper project?

Example:
`
var sql = "SELECT P.Id, P.FirstName, P.LastName, " +
"A.Id AS AddressId, A.StreetNumber, A.StreetName, A.City, A.State " +
"FROM People P INNER JOIN Addresses A ON A.AddressId = P.AddressId; ";

db.Query<Person, Address, Person>(
sql,
(person, address) => {
person.Address = address;
return person;
},
splitOn: "AddressId"
).ToList();

`

As you know, we currently use EF6, and unfortunately it does not produce efficient queries. So, it is better to write pure SQL queries for our read model using Dapper repository.

By the way, I am ready for contribution.

Implement more CQRS oriented structures

  • Command, SequencedCommand

  • CorrelationId/CausationId approach for each command

  • CorrelationId/CausationId aware Context implementation. This will provide these Ids in its context
    e.g ICommandContext {CorrelationId, CausationId} per thread.

    Enter context (command)
    Do stuff
    Save
    
  • Consider removing ApplicationServices and introduce CommandHandler and provide a generic IHandles<T>

Project Info

This code is similar to the asp.net boilerplate project
I'd say the even
Whats the difference?

Thanks

Package Updates

  • DapperExtensions 1.5.0 --> 1.6.0
  • EntityFramework.DynamicFilters 2.8.1 --> 2.9.0
  • RavenDB.Client 3.5.3 --> 3.5.4
  • JetBrains.Annotations 10.4.0 --> 11.0.0

EventBus disposing problem

Error: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.

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.