All Projects → reinforced → Reinforced.tecture

reinforced / Reinforced.tecture

Licence: mit
Aspect-based architectural framework for .NET business applications involving some FP and CQRS principles.

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Reinforced.tecture

Akkatecture
a cqrs and event sourcing framework for dotnet core using akka.net
Stars: ✭ 414 (+266.37%)
Mutual labels:  netstandard, dotnet-core, cqrs
Eventsourcing.netcore
Examples and Tutorials of Event Sourcing in .NET Core
Stars: ✭ 760 (+572.57%)
Mutual labels:  dotnet-core, cqrs
Eventstore
Event store using PostgreSQL for persistence
Stars: ✭ 729 (+545.13%)
Mutual labels:  database, cqrs
Raft.net
Implementation of RAFT distributed consensus algorithm among TCP Peers on .NET / .NETStandard / .NETCore / dotnet
Stars: ✭ 112 (-0.88%)
Mutual labels:  netstandard, dotnet-core
Metadata Extractor Dotnet
Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Stars: ✭ 518 (+358.41%)
Mutual labels:  netstandard, dotnet-core
Steeltoe
Steeltoe .NET Core Components: CircuitBreaker, Configuration, Connectors, Discovery, Logging, Management, and Security
Stars: ✭ 612 (+441.59%)
Mutual labels:  netstandard, dotnet-core
Cqrslite
A lightweight framework to help creating CQRS and Eventsourcing applications in C#
Stars: ✭ 925 (+718.58%)
Mutual labels:  dotnet-core, cqrs
Bankflix
Aplicação que simula um banco digital, contendo a área do cliente e administrativa, permitindo depósitos e transferências entre contas do mesmo banco. | Application that simulates a digital bank, containing the customer and administrative areas, allowing deposits and transfers between accounts of the same bank.
Stars: ✭ 82 (-27.43%)
Mutual labels:  dotnet-core, cqrs
Couchdb Net
EF Core-like CouchDB experience for .NET!
Stars: ✭ 50 (-55.75%)
Mutual labels:  database, netstandard
Computesharp
A .NET 5 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders, with the goal of making GPU computing easy to use for all .NET developers! 🚀
Stars: ✭ 982 (+769.03%)
Mutual labels:  netstandard, dotnet-core
Kledex
.NET Standard framework to create simple and clean design. Advanced features for DDD, CQRS and Event Sourcing.
Stars: ✭ 502 (+344.25%)
Mutual labels:  dotnet-core, cqrs
Dotnetcore Microservices Poc
Very simplified insurance sales system made in a microservices architecture using .NET Core
Stars: ✭ 1,304 (+1053.98%)
Mutual labels:  dotnet-core, cqrs
Csharp Driver
DataStax C# Driver for Apache Cassandra
Stars: ✭ 477 (+322.12%)
Mutual labels:  database, dotnet-core
Shriek Fx
An easy-to-use rapid development framework developed on the basis of.NET Core 2.0, following the constraints of domain Driven Design (DDD) specifications, combined with the CQRS architecture to provide the infrastructure for event-driven, event backtracking, responsiveness, and more. Let developers enjoy the true meaning of object-oriented design patterns brought by the aesthetic.
Stars: ✭ 644 (+469.91%)
Mutual labels:  dotnet-core, cqrs
Eventstore
The stream database optimised for event sourcing
Stars: ✭ 4,395 (+3789.38%)
Mutual labels:  database, cqrs
Polygen
PolyGen is a code generator that produces database schema, ORM layer, REST API and a (coming soon — stay tuned!) single-page web UI for your business model.
Stars: ✭ 19 (-83.19%)
Mutual labels:  database, dotnet-core
Dbreeze
C# .NET MONO NOSQL ( key value store embedded ) ACID multi-paradigm database management system.
Stars: ✭ 383 (+238.94%)
Mutual labels:  database, netstandard
Netcoremicroservicessample
Sample using micro services in .NET Core 3.1 Focusing on clean code
Stars: ✭ 403 (+256.64%)
Mutual labels:  dotnet-core, cqrs
Realm Dotnet
Realm is a mobile database: a replacement for SQLite & ORMs
Stars: ✭ 927 (+720.35%)
Mutual labels:  database, dotnet-core
Entityframeworkcore.dataencryption
A plugin for Microsoft.EntityFrameworkCore to add support of encrypted fields using built-in or custom encryption providers.
Stars: ✭ 88 (-22.12%)
Mutual labels:  netstandard, dotnet-core

What is that?

This is experimental architecture framework for business applications made on .NET platform.

Reinforced.Tecture is available on NuGet along with its dependent packages.

PM> Install-Package Reinforced.Tecture
PM> Install-Package Reinforced.Tecture.Aspects.Orm
PM> Install-Package Reinforced.Tecture.Aspects.DirectSql
PM> Install-Package Reinforced.Tecture.Runtimes.EfCore
PM> Install-Package Reinforced.Tecture.Testing

Get in touch with documentation

What are benefits?

Tecture gives you benefits depending on your role in the team. So in case if you are...

Below are several pieces of code that uses Tecture:

Abstractions of external systems

Define channels and use aspects:

/// <summary>
/// Hi, I'm database communication channel
/// </summary>
public interface Db :
        CommandQueryChannel<
	   Reinforced.Tecture.Aspects.Orm.Command, 
	   Reinforced.Tecture.Aspects.Orm.Query
	  >
    { }

Organize your business logic

Create services for business logic and produce commands

/// <summary>
/// I'm orders service. And these are my type parameters (tooling). 
///	                  By using them I say that I can update orders and add order lines
/// </summary>                       |                               |
public class Orders : TectureService< Updates<Order>, Adds<OrderLine> >
{
	private Orders() { }

	/// <summary>
	/// And I'm business logic method
	/// </summary>
	/// <param name="orderId">I consume order id</param>
	/// <param name="poductId">and product id</param>
	/// <param name="quantity">and also product quantity</param>
	public void CreateLine(int orderId, int poductId, int quantity)
	{
		// I perform queries to the database
		var order = From<Db>.Get<Order>().ById(orderId);
		
		// My aspect allows me to add order lines
		To<Db>().Add(new OrderLine
				{
						OrderId = orderId,
						ProductId = productId,
						Quantity = quantity
				}
		);

		// And only update orders
		To<Db>.Update(order)
		      .Set(x=>x.TotalQuantity, order.TotalQuantity + quantity);

		// Also I can invoke other services
		Let<Products>().AttachToOrder(order);
	}
}

Manage read operations

Define queries for your channels

///<summary>
/// I'm entity interface...
///</summary>
public interface IEntity { int Id { get; } }

public static class Extensions
{
	///<summary>
	/// ...and you don't need repositories anymore to get me by Id
	///</summary>
	public static T ById<T>(this IQueryFor<T> q, int id) where T : IEntity
	{
		return q.All.FirstOrDefault(x => x.Id == id);
	}
	
	///<summary>
	/// Even if you have SQL
	///</summary>
	public static IEnumerable<Order> GetRecentOrders(this Read<Db> db)
	{
		return db.SqlQuery<Order>(o => 
			$"SELECT * FROM {o} WHERE DATEDIFF(day, {o.UpdatedAt}, GETDATE()) < 30"
		).As<Order>();
	}
}

// ... 
var o = From<Db>().GetRecentOrders();
// ...

Connect Tecture to your application

Tecture can be easily registered in any IoC container and used from application

public class OrdersController : ApiController
{
	// You can inject
	private readonly ITecture _tecture;

	public OrdersController(ITecture tecture)
	{
		_tecture = tecture;
	}

	public ActionResult PerformActionWithOrder(int id)
	{
		// and use it  
		_tecture.Let<Orders>().PerformAction(id);
		_tecture.Save();

		return Ok();
	}
}

Get explanation of your business logic

Trace your business logic and get clear explanation what exactly it does with external systems:

tecture.BeginTrace();

var a = tecture.Let<Orders>().CreateOne("new order");
ctx.Save();

var trace = tecture.EndTrace();
Output.Write(trace.Explain());

/**
 * 1. [ ->] 	Check existing order presence: 'False' obtained
 * 2. [ADD] 	Adding new order to the database
 * 3. [<- ] 	<SAVE>
 * 4. [SQL] 	Re-calculating denormalized items count
 * 5. [<- ] 	<SAVE>
 * 6. [ ! ] 	<END>
 */

Create unit tests without pain

Extract test data from the trace and dump it into C# code. Convert tract into validation code. Put them together to get data-driven infrastructure-free unit test

[Fact]
public void Order_Creation_Works_As_Expected()
{
	using var c = Case<Order_Creation_Works_As_Expected_TestData>(out ITecture ctx);

	var a = ctx.Let<Orders>().CreateOne("test order");
	ctx.Save();
	
	c.Validate<Order_Creation_Works_As_Expected_Validation>();
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].