Skip to content

REFACTOR: multiple refactors for improving structure and concepts implementations.#93

Merged
CesarD merged 8 commits intomainfrom
refactor/domain_refactors_and_others
Aug 22, 2025
Merged

REFACTOR: multiple refactors for improving structure and concepts implementations.#93
CesarD merged 8 commits intomainfrom
refactor/domain_refactors_and_others

Conversation

@CesarD
Copy link
Collaborator

@CesarD CesarD commented Jun 19, 2025

This PR performs several refactors about multiple topics I wanted to improve for some time after some additional experience that I believe should help simplify things in areas like project structure, concepts implementation, samples implementations, etc. as well as including some documentation for the internal libraries.

  • REFACTOR: Merged all 3 Application projects into a single one for the sake of simplifying solution structure. Having a single Application project that includes infrastructure configuration and migrations aligns better with the concept of Vertical Slices Architecture and reduces additional structure at the solution level. If required, developers can always split sections of the Application into separate assemblies if required for whatever reason, but Monaco should not early-optimize without additional context. This also helps simplify microservices implementation if desired.
  • REFACTOR: Added AggregateRoot base class for differentiating between aggregate roots and other regular entities. Moved domain events into AR to better represent its responsibilities.
  • REFACTOR: Separated Entities and ValueObjects into different namespaces.
  • REFACTOR: Moved Application DTOs to corresponding feature folders for a better location and maintenance ease.
  • REFACTOR: To better match aggregate roots responsibilities, the Product entity has been refactored as its own AR and modified the entire relationship and business logic it had against Company. All related tests and configurations have been modified accordingly.
  • DOCS: Documentation has been added to several core classes and components to improve DX.
  • CHORE: Dependencies have been updated.
  • REFACTOR: CommandResults converted to Records to better represent their concept as DTOs.
  • REFACTOR: Worker service project renamed from Service to Worker for better understanding.
  • REFACTOR: BlobStorageService refactored to remove temp folder and instead represent the temporal status only in database, making easier the files management at the storage level. No more moving files to make them permanent. Added a path variable to allow setting the path of the blob within the container.

…aggregate roots and other regular entities. Moved domain events into AR to better represent its responsibilities.

REFACTOR: Separated Entities and ValueObjects into different namespaces.
REFACTOR: Moved Application DTOs to corresponding feature folders for a better location and maintenance ease.
REFACTOR: To better match aggregate roots reponsibilities, the Product entity has been refactored as its own AR and modified the entire relationship and business logic it had against Company. All related tests and configurations have been modified accordingly.
DOCS: Documentation has been added to several base classes to improve DX.
UPDATE: Dependencies have been updated.
REFACTOR: CommandResults converted to records to better represent their concept as DTOs.
REFACTOR: Worker service project renamed from Service to Worker for better understanding.
REFACTOR: BlobStorageService refactored to remove temp folder and instead represent the temporal status only in database, making easier the files management at the storage level. No more moving files to make them permanent. Added a path variable to allow setting the path of the blob within the container.
@CesarD CesarD added documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file labels Jun 19, 2025
@socket-security
Copy link

socket-security bot commented Jun 19, 2025

@CesarD CesarD marked this pull request as ready for review June 22, 2025 19:13
…tralization of infrastructure tests into application layer tests.
Copilot AI review requested due to automatic review settings August 19, 2025 05:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR performs a comprehensive refactoring of the Monaco template to improve architectural structure and domain-driven design implementation. The changes consolidate project structure, enhance domain modeling, and simplify file management.

  • Merged three Application projects into a single one to simplify solution structure and better align with Vertical Slices Architecture
  • Introduced AggregateRoot base class to properly distinguish aggregate roots from regular entities and centralize domain events management
  • Refactored Product entity as its own aggregate root with enhanced business logic and better relationship management with Company
  • Reorganized namespaces to separate Entities and ValueObjects for better domain organization

Reviewed Changes

Copilot reviewed 149 out of 152 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Monaco.Template.Backend.sln Removes separate Infrastructure and Migrations projects, consolidates into Application
Monaco.Template.Backend.Worker/* Renames Service project to Worker for better clarity
Domain/Model/Entities/* Moves entities to dedicated namespace and converts to aggregate roots
Domain/Model/ValueObjects/* Separates value objects into dedicated namespace
Application/Features//DTOs/ Moves DTOs to feature-specific folders for better organization
Application/Persistence/* Consolidates persistence layer into Application project
Common.Domain/Model/* Introduces AggregateRoot base class and enhances Entity with documentation
Common.BlobStorage/* Simplifies blob storage by removing temp folder concept
Files not reviewed (1)
  • src/Content/Backend/Solution/Monaco.Template.Backend.Application/Persistence/Migrations/20250524100737_Init.Designer.cs: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@CesarD CesarD requested a review from matthewtoghill August 19, 2025 19:33
@CesarD CesarD requested a review from matthewtoghill August 21, 2025 18:54
@CesarD CesarD merged commit 609ed0a into main Aug 22, 2025
2 checks passed
@CesarD CesarD deleted the refactor/domain_refactors_and_others branch August 22, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants