Chapter 10. A field guide to objects

 

This chapter covers

  • Different types of objects you’ll find in a typical web application
  • How different types of objects work together
  • In which application layer these objects live
  • How these layers are related

So far we’ve discussed style guidelines for object design. These are meant to be general-purpose rules that can be applied everywhere, but this doesn’t mean that all the objects in your application will look the same. Some objects will have lots of query methods and some will have only command methods. Some will have a mix of both, but with a certain ratio of them. You may find that different types of objects often share certain characteristics, which results in pattern names to be invented for them. For instance, developers will talk about “entities,” “value objects,” or “application services” to indicate the nature of the object they’re talking about.

10.1. Controllers

10.2. Application services

10.3. Write model repositories

10.4. Entities

10.5. Value objects

10.6. Event listeners

10.7. Read models and read model repositories

10.8. Abstractions, concretions, layers, and dependencies

Summary