eShopOnWeb has some really nice examples of encapsulation. The particular example below is the CatalogItem class. Click on the image … Continue reading eShopOnWeb Architecture (6/16) – uses private setters and non default constructors to support encapsulation which helps keep the model valid
Category: Software Architecture
eShopOnWeb Architecture (5/16) – makes regular use of Guard Clauses
eShopOnWeb makes regular use of Guard Clauses… this is when we test our variables early for problems and throw an … Continue reading eShopOnWeb Architecture (5/16) – makes regular use of Guard Clauses
eShopOnWeb Architecture (4/16) – uses the MediatR library to keep controllers thin
eShopOnWeb uses Jimmy Bogards MediatRÂ package to keep controllers thin. This package is a simple implementation of the mediator design pattern … Continue reading eShopOnWeb Architecture (4/16) – uses the MediatR library to keep controllers thin
eShopOnWeb Architecture (3/16) – uses custom exceptions to more explicitly express what has gone wrong
In the ApplicationCore project eShopOnWeb defines some custom exceptions… This approach means we can raise strongly typed exceptions rather than … Continue reading eShopOnWeb Architecture (3/16) – uses custom exceptions to more explicitly express what has gone wrong
eShopOnWeb Architecture (2/16) – uses Value Objects to model immutable domain concepts
Value Objects (VO) are a core part of DDD. A Value Object is an immutable type that is distinguishable only … Continue reading eShopOnWeb Architecture (2/16) – uses Value Objects to model immutable domain concepts
Using Guard Clauses to reduce nesting levels in our code
File-level namespaces in C# 10 will help us remove a level of nesting in our code. This is helpful but.. … Continue reading Using Guard Clauses to reduce nesting levels in our code
What to look for when reviewing code for SOLID principle ‘violations’
If your tasked with doing a code review of a fellow developers code or indeed are looking to improve an … Continue reading What to look for when reviewing code for SOLID principle ‘violations’