Your task

Your task in this tutorial is to check out a series of tags and review the changes. These commits make small changes to the domain model as we're now adding the notion of trustees to the model. We're sticking with the hard-coded in-memory repository for now.

The key point to notice here is that we focus on subsets of the application and think about moving those forward and then offering interfaces that can provide access to the new functionality.

A good motto here is to work with code that "fits in your head" (adapting that phrase from Dan North's book "Software Faster")

In tag 014-add-trustee, we add Trustee classes. Note the difference in modelling styles. Trustee domain objects are linked to the charity domain object, but the DTOs are not. To get the trustee DTOs, the client will need to use the service.

We do this because we want the domain model to be a realistic model of the business domain, whereas the DTO model is more tuned to the needs of the application. It is unlikely that the user interface will show the trustees to the users that often, but our admin functionality will need it more often.

Therefore, the design decision has been taken to make clients specifically ask for the trustees for a charity.

Look at tag 015-refactor-packages. This is a small, package refactoring that tries to make it clearer to future developers as to where functionality will reside. In a large codebase, it is good practice to try to provide a sensible and consistent "road-map" to the correct code. This is not the only way of decomposing the codebase and it won' be the best in all circumstances, but it illustrates the principle.

Look at tag 016-refactor-repository. This is a small change made to the repository that makes it easier to do certain searches. Even though the commit includes a change to the service layer, that change is merely spacing. The repository has been changed without impacting on the service layer or those layers above it. This is a good thing to strive to achieve. We've reduced the "blast radius" of change. NOTE: "blast radius" is a term that you may also hear in cyber security when referring to the impact of an attack.