All Projects → damianopetrungaro → clean-architecture

damianopetrungaro / clean-architecture

Licence: MIT license
Package for isolate your domain code from framework dependency using DDD concepts.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to clean-architecture

Clean-Architecture-Template
Configurable Clean Architecture template containing the DDD + CQRS approach for .NET Core applications.
Stars: ✭ 14 (-84.95%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
Architecture
.NET 6, ASP.NET Core 6, Entity Framework Core 6, C# 10, Angular 13, Clean Code, SOLID, DDD.
Stars: ✭ 2,285 (+2356.99%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
Plastic
This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application.
Stars: ✭ 30 (-67.74%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
EcommerceDDD
Experimental full-stack application using Domain-Driven Design, CQRS, and Event Sourcing.
Stars: ✭ 178 (+91.4%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
Run Aspnetcore
A starter kit for your next ASP.NET Core web application. Boilerplate for ASP.NET Core reference application, demonstrating a layered application architecture with applying Clean Architecture and DDD best practices. Download 100+ page eBook PDF from here ->
Stars: ✭ 227 (+144.09%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
MonolithicArchitecture
This repository presents an approach on how to build an application using Monolithic architecture, ASP.NET Core, EntityFrameworkCore, Identity Server, CQRS, DDD
Stars: ✭ 18 (-80.65%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
buchu
Use Cases - Uniform, auditable and secure use case library
Stars: ✭ 23 (-75.27%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
educational-platform
Modular Monolith Java application with DDD
Stars: ✭ 124 (+33.33%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
Dotnet New Caju
Learn Clean Architecture with .NET Core 3.0 🔥
Stars: ✭ 228 (+145.16%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
Modular Monolith With Ddd
Full Modular Monolith application with Domain-Driven Design approach.
Stars: ✭ 6,210 (+6577.42%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
repository
[PHP 7] Implementation and definition of a base Repository in Domain land.
Stars: ✭ 26 (-72.04%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
Event Sourcing Castanha
An Event Sourcing service template with DDD, TDD and SOLID. It has High Cohesion and Loose Coupling, it's a good start for your next Microservice application.
Stars: ✭ 68 (-26.88%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
clean-ddd-php-poc-contacts
A simple contact manager API to demonstrate the concepts of Clean Architecture and DDD with PHP 7.4+.
Stars: ✭ 31 (-66.67%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
Jivejdon
Jivejdon is a Domain Driven Design appication with CQRS/ES/Clean/Hexagonal architecture
Stars: ✭ 287 (+208.6%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
Cp Ddd Framework
A lightweight flexible development framework for complex business architecture with full ecosystem!轻量级业务中台开发框架,中台架构的顶层设计和完整解决方案!
Stars: ✭ 566 (+508.6%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
Sample Dotnet Core Cqrs Api
Sample .NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture.
Stars: ✭ 1,273 (+1268.82%)
Mutual labels:  ddd, domain-driven-design, clean-architecture
tactical-ddd
lightweight helpers that I find myself implementing over and over again related to DDD/Event Sourcing tactical patterns, such as Value Objects, Entities, AggregateRoots, EntityIds etc...
Stars: ✭ 33 (-64.52%)
Mutual labels:  ddd, domain-driven-design
Laravel Api Templates
Laravel API starter kit collection using different structures.
Stars: ✭ 149 (+60.22%)
Mutual labels:  ddd, domain-driven-design
Event Sourcing Jambo
An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)
Stars: ✭ 159 (+70.97%)
Mutual labels:  ddd, domain-driven-design
Revo
Event Sourcing, CQRS and DDD framework for C#/.NET Core.
Stars: ✭ 162 (+74.19%)
Mutual labels:  ddd, domain-driven-design

clean-architecture

Code Climate Build Status

Package for isolate your domain code from framework dependency

What are Domain,Application and Infrastructure layer? Click here for a resume.

Why?

Why did you code this package?

When I code, I usually isolate the Domain layer from Application layer and Infrastructure layer, and every time I do it I need to re-build a set of objects that helps me doing this.

Those objects often are a Request, a Response and some Errors.

This package is born for me, to avoid re-building such set of objects, also avoiding some copy/paste from different projects.

Why should you isolate your domain code from Application and Infrastructure dependencies?

Imagine that your PHP application is currently built on top of Laravel framework.

And use a modern frameworks (such Laravel, Symfony or Slim) is a very good thing. Helps you to write a better code without reinvent the wheel.

But what if you want/must switch your current framework for performance, architectural or other reasons to an another one?

Usually this is very painful, and you are despondent to change it. This choose bind you to a tool that might not be as good as before for your project.

And this is only an example. There can be a lot of more reasons why you want to change framework.

How can I isolate it?

Using some DDD concepts, you can totally (or almost) isolate your domain code from the Application layer (Laravel for example) and from the Infrastructure layer (Postgresql or Mysql for example).

So the Domain of my application is not relegated to a particular framework/package/database, and can be "easily" switched.

What hepls me to realize this package?

There are some books that helped me to "think" in this way. Here some of them:

Clean PHP

DDD in PHP

DDD by Evans

A Minimal Documentation

  • Common

    • Collections

      • Collection

        An interface to use instead an array of objects.

      • ArrayCollection

        An implementation of Collection using php array.

    • Enum

      • Enum

        Used for give Enum support on PHP.

      • ReflectionEnum

        An implementation of Enum using reflection.

  • Mapper

    • Mapper

      An interface to use for transform object into array and viceversa.

    • UserMapper

      An interface to use for transform User instances into array and viceversa.

  • Persistence

    • Transaction

      An interface to use for transaction cross Bounded Contexts.

  • Use Cases

    • UseCase

      An interface to use for isolate the use case from the request (CLI,HTTP...).

    • Error

      • Error

        A representation of a generic error in the domain. The error it will be specified using type & code.

      • AbstractError

        An abstract implementation of ErrorInterface.

      • ErrorType

        An interface that extends Enum, used for specify all the error type of your domain.

      • AbstractErrorType

        An implementation of ErrorType.

    • Request

      • Request

        An interface used as DTO for pass data from the infrastructure/application to the domain.

      • CollectionRequest

        An implementation of the Request using Collection.

    • Response

      • Response

        An interface used for pass data from the domain to the infrastructure/application, it uses two main properties Errors: pass all "errors" Data: pass all other "data/information"

      • CollectionResponse

        An implementation of Response using Collection.

    • Validation

      • ValidableRequest

        An interface used for the validate request's data inside the self request

      • ValidableUseCase

        An interface used for the validate request's data inside the UseCase

A Practical Example

  • Slim

    This is a simple example of a TODO list of users, using slim microframework and clean architecture package. For any doubt or info add an issue.

Changelog

[0.4] 2018-06-01

  • [BC] added a type-hing to Enum interface. You need to adapt equals method in your class implementing such inteface (or extending ReflectionEnum class)
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].