For learning and discussion purposes I’ve done up a series of short articles looking at the architecture of eShopOnWeb which … Continue reading eShopOnWeb architecture article series (16 parts)
Category: eShopOnWeb
eShopOnWeb Architecture (16/16) – uses clean architecture
On a high level eShopOnWeb uses clean architecture. The main idea of clean architecture is that the solution is spilt … Continue reading eShopOnWeb Architecture (16/16) – uses clean architecture
eShopOnWeb Architecture (15/16) – has a really nice example of the Interface Segregation Principle
We can see a nice example of the interface segregation principle in eShopOnWeb. For its repository interfaces eShopOnWeb have two … Continue reading eShopOnWeb Architecture (15/16) – has a really nice example of the Interface Segregation Principle
eShopOnWeb Architecture (14/16) – uses parameterized tests
I love parameterized tests. Instead of adding many different test methods with different inputs set in the method body we … Continue reading eShopOnWeb Architecture (14/16) – uses parameterized tests
eShopOnWeb Architecture (13/16) – has some single implementation interfaces
eShopOnWeb has a couple of its service classes (BasketService and OrderService) implement corresponding interfaces (IBasketService and IOrderService). These interfaces have … Continue reading eShopOnWeb Architecture (13/16) – has some single implementation interfaces
eShopOnWeb Architecture (12/16) – uses the repository and specification pattern
eShopOnWeb uses the repository pattern over Entity Framework ((I’m not getting into this debate again 😉). When we use this pattern we … Continue reading eShopOnWeb Architecture (12/16) – uses the repository and specification pattern
eShopOnWeb Architecture (11/16) – uses AutoMapper
eShopOnWeb has a couple of uses of AutoMapper just so developers can see how to wire it up but in general … Continue reading eShopOnWeb Architecture (11/16) – uses AutoMapper
eShopOnWeb Architecture (10/16) – has unit tests which test very low level implementation details
eShopOnWeb has some really low level tests which IMHO provide low or no value in terms of being able to … Continue reading eShopOnWeb Architecture (10/16) – has unit tests which test very low level implementation details
eShopOnWeb Architecture (9/16) – uses the Aggregate root pattern to ensure child objects are not manipulated out of context
Aggregate roots are a central concept in Domain Driven Design. The idea is pretty simple and refers to how certain entities … Continue reading eShopOnWeb Architecture (9/16) – uses the Aggregate root pattern to ensure child objects are not manipulated out of context
eShopOnWeb Architecture (8/16) – uses in memory caching to avoid sending unnecessary queries to the DB
To improve performance eShopOnWeb uses IMemoryCache to implement in memory caching to prevent queries being sent to the Database for … Continue reading eShopOnWeb Architecture (8/16) – uses in memory caching to avoid sending unnecessary queries to the DB
eShopOnWeb Architecture (7/16) – encapsulates navigation collections so consumers can’t edit them directly
Another example of encapsulation but this time on the navigation collection level is seen in eShopOnWeb with the use of … Continue reading eShopOnWeb Architecture (7/16) – encapsulates navigation collections so consumers can’t edit them directly
eShopOnWeb Architecture (6/16) – uses private setters and non default constructors to support encapsulation which helps keep the model valid
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
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
eShopOnWeb Architecture (1/16) – uses marker interfaces to communicate intent and enforce design constraints
eShopOnWeb has an interface called IAggregateRoot which has no methods or properties… what’s that about? Well empty interfaces like this … Continue reading eShopOnWeb Architecture (1/16) – uses marker interfaces to communicate intent and enforce design constraints