Giter VIP home page Giter VIP logo

cqelight's Introduction

CQELight

Documentation is available at : https://cqelight.readthedocs.io

Build Status Documentation Status

Description

CQELight is an entreprise grade extensible and customisable framework for creating softwares with DDD, Command Query & Event Sourcing.

DDD, CQRS and Event-sourcing are great topics, but it's not always easy to get started with them. Here's where CQELight is.

CQELight allows you to do clean loosely coupled architecture for your software developpments. Like this, you won't have to worry about technical stuff, just focus on business stuff and rely on CQELight system to help you build and run your system.

Based on Domain Driven Design, you can create your objects within boundaries, as aggregates, entities or value objects. With this clean object architecture, you can perform simple, flexible and extensible CQRS operations for interact with the system.

Moreover, CQELight bundle a bunch of tools used in all entreprise-grade projects such as IoC or Data Access Layer, among other things.

Available packages :

Extension name Stable
CQELight NuGet
AspNetcore NuGet
InMemory Bus NuGet
RabbitMQ Bus NuGet
Azure Service Bus NuGet
Autofac IoC NuGet
Microsoft Extensions DependencyInjection IoC NuGet
MongoDb EventStore NuGet
EF Core EventStore NuGet
EF Core DAL NuGet
MongoDb DAL NuGet
TestFramework NuGet
MVVM NuGet
MVVM - MahApps implementation NuGet

Quick getting started - The 'Hello World!' example

To get really quick started, create a new console application

dotnet new console

Edit your csproj to use latest C# version

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>

</Project>

Add CQELight & CQELight.Buses.InMemory packages

dotnet add package CQELight | dotnet add package CQELight.Buses.InMemory

Create a new class GreetingsEvent.cs and add the following content

using CQELight.Abstractions.Events;
namespace HelloWorld.Events
{
    class GreetingsEvent : BaseDomainEvent
    {
    }
}

Create a new class GreetingsEventHandler.cs and add the following content

using CQELight.Abstractions.Events.Interfaces;
using CQELight.Abstractions.DDD;
using HelloWorld.Events;
using System;
using System.Threading.Tasks;

namespace HelloWorld.Handlers
{
    class GreetingsEventHandler : IDomainEventHandler<GreetingsEvent>
    {
        public Task<Result> HandleAsync(GreetingsEvent domainEvent, IEventContext context = null)
        {
            Console.WriteLine("Hello world!");
            return Result.Ok();
        }
    }
}

Modify Program.cs as following

using CQELight;
using CQELight.Dispatcher;
using HelloWorld.Events;
using System;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {
        static async Task Main(string[] args)
        {
            new Bootstrapper()
                .UseInMemoryEventBus()
                .Bootstrapp();

            await CoreDispatcher.PublishEventAsync(new GreetingsEvent()).ConfigureAwait(false);

            Console.Read();
        }
    }
}

Then, execute dotnet run, Hello World! should be visible on console

cqelight's People

Contributors

azure-pipelines[bot] avatar cdie avatar christophe-mommer avatar stauweak avatar thanouz avatar

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.