stoveproject / stove Goto Github PK
View Code? Open in Web Editor NEWDomain Driven Design oriented application framework, meets CRUD needs
License: MIT License
Domain Driven Design oriented application framework, meets CRUD needs
License: MIT License
Implement as default:
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.
Should work with Stove.Dapper under same NH transaction
Stove.Dapper be able to share NHibernate transaction and policies, commit, rollback etc...
EventData to Event
This may or may not contain breaking changes. For sure needs more eye.
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
Hi,
thanks for your project, i have a question about dapper.
how to use the dapper in your framework.
thanks!
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.
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>
And cover all breaking changes.
Might be a bool value on IEventData as PublishToMessageBus
This code is similar to the asp.net boilerplate project
I'd say the even
Whats the difference?
Thanks
It is CRUDY and carries proxied object as event body.
Rename EventBus.Trigger to EventBus.Publish behalf of cosmetic concerns about DDD language.
what‘s different with abp framework?
Error: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.