Skip to content

List Patterns

A list pattern is a design pattern that is used to create a list of items. Depending on the functional and technical requirements of the application, different list patterns can be used. Each pattern is designed to solve a specific problem or to meet a specific requirement. Some patterns dictate the nature of the implementation, while others address specific concerns like pagination or filtering.

Attributes

The attributes to consider when deciding for a pattern to implement a solution to a specific problem are:

  • Filtering: How to filter the list of items? Which fields are available for filtering? How smart the filtering should be?
  • Sorting: How to sort the list of items? Which fields are available for sorting? Is sorting by multiple fields allowed?
  • Pagination: How to paginate the list of items? How many items should be displayed per page? Is the total count of items displayed?
  • Consistency: How to ensure that the list of items is consistent? How to handle concurrency issues?
  • Performance: How to ensure that the list of items is performant? How to optimize the queries?
  • Evolution: How to ensure that the list of items can evolve? How to handle changes in the requirements?
  • Denormalization: Is it necessary to denormalize the list of items? How to ensure that the list of items is up-to-date?

For each attributes we need to consider the following questions:

  • How complex actually is the attribute? Do not try to design a solution for a problem that does not exist.
  • How much value the system will get from the attribute? Do not incur in technical debt for a feature that is not used.
  • How open to evolution the attribute is? Do not design a solution that will not be able to evolve with the system.

Conventions