Large enterprise .NET projects come in all shapes and sizes, but at SSW we’ve always had a desire to make it follow a whole bunch of rules so that we incorporate all the best practices from past projects. A huge benefit is when a software developer moves from one client to another, the structure looks very familiar, and therefore they can get into the business problem quicker.
When you start a new project, it can take ages, weeks to get the API into a decent shape. What I’m going to announce today will make a ton of .NET developers very happy, because they can get the best practices solution now in minutes.
Since .NET 1.0, SSW has always had a ‘data guy’, who is in charge of best practices around structuring software projects.
A year ago, again I got some of my Solution Architects, Daniel M (opens in a new tab)., William L (opens in a new tab)., Matt G (opens in a new tab)., Matt W., (opens in a new tab) Chris C., (opens in a new tab) as well as young gun Luke P. (opens in a new tab) together and we spent a few wonderful days in Mittagong on an “Architecture Retreat”. In between fancy dinners, lunches, and breakfasts, one of our goals was to decide what our general architectural recommendations should be going forward. As a result, we decided to create an open-source project: SSW Clean Architecture Template (aka SSW CA) (opens in a new tab) which the team has been using and working on for the past year.
We have now decided that the template has matured enough to announce it as GA (Generally Available)! 🥳
🔔 Ding dong! We're excited to announce the release of our SSW #CleanArchitecture (opens in a new tab) #Template (opens in a new tab) v2024.2! 🔔 This version has been a year of hard work and was kicked off at our Clean Architecture Retreat in Mittagong.It's finally ready for you to use on your .NET projects.Our goal… pic.twitter.com/UVgNNHEwUO (opens in a new tab)
— SSW / SSW TV (@SSW_TV) March 14, 2024 (opens in a new tab)
✅ You can find the template GitHub here: github.com/SSWConsulting/SSW.CleanArchitecture (opens in a new tab)
The main driver behind building an SSW template was to rapidly kick-start client projects in a consistent way that aligns with SSW’s best practices. This template is not only used on SSW projects, but you can also learn it from our Clean Architecture 1-day Superpowers (opens in a new tab) and 2-day Workshop (opens in a new tab) events.
We are also doing regular Community Updates which are posted to the Software Architecture Whiterobes (SAW) YouTube channel (opens in a new tab). Check out the content and let us know what you think!
✨ Features (opens in a new tab)
- 🔨
dotnet newcli template – to get you started quickly - 📦 Slim – no authentication provider, no authorization & no UI framework
- You can add these yourself or use one of our reference architectures from awesome-clean-architecture (opens in a new tab)
- 🎯 Domain Driven Design Patterns
- AggregateRoot
- Entity
- ValueObject
- DomainEvent
- 🌐 Minimal Endpoints – because it’s fast & simple. ⚡
- Extension methods to ensure consistent HTTP Verbs & Status Codes
- 📝 OpenAPI/Swagger – easily document your API
- 🔑 Global Exception Handling – it’s important to handle exceptions in a consistent way & protect sensitive information
- Transforms exceptions into a consistent format following the RFC7231 memo (opens in a new tab)
- 🗄️ Entity Framework Core – for data access
- Comes with Migrations & Data Seeding
- 🧩 Specification Pattern – abstract EF Core away from your business logic
- 🔀 CQRS – for separation of concerns
- 📦 MediatR – for decoupling your application
- 📦 FluentValidation – for validating requests
- 📦 AutoMapper – for mapping between objects
- 🆔 Strongly Typed IDs – to combat primitive obsession
- e.g. pass
CustomerIdtype into methods instead ofint, orGuid - Entity Framework can automatically convert the int, Guid, nvarchar(..) to strongly typed ID.
- 📁 Directory.Build.Props
- Consistent build configuration across all projects in the solution
- e.g. Treating Warnings as Errors for Release builds
- Custom per project
- e.g. for all test projects we can ensure that the exact same versions of common packages are referenced
- e.g. XUnit and NSubstitute packages for all test projects
- ⚖️ EditorConfig – comes with the SSW.EditorConfig (opens in a new tab)
- Maintain consistent coding styles for individual developers or teams of developers working on the same project using different IDEs
- 🧪 Testing
- Simpler Unit Tests for Application
- No Entity Framework mocking required thanks to Specifications
- Better Integration Tests
- Integration Tests at Unit Test speed
- Test Commands and Queries against a Real database
- No Entity Framework mocking required
- No need for In-memory database provider
- Architecture Tests
- Know that the team is following the same Clean Architecture fundamentals
- The tests are automated so discovering the defects is fast
The template is open source and we have a lot of exciting upcoming features. If you have any feedback please submit a GitHub Issue (opens in a new tab).
If you need help on any architecture-related matters, feel free to get in touch: ssw.com.au/company/contact-us (opens in a new tab)

Comments
No comments on this post.