Configuration or a new implementation: when to stop adding settings

Examine three differences between two sites: a configuration value, an algorithm under a shared contract, and a product-specific scenario.

Adjustment, a replacement working part, and a separate tool address different reasons for change.

Another setting is added to a shared listing page. Only one site needs it, but it seems cheaper than a new class. A few changes later, it is difficult to explain which parameter combinations are valid, who checks their meaning, and why one mistake changes the behaviour of a neighbouring product.

The number of settings does not provide a ready answer. A long list of colours can be simpler than one switch that changes permissions, the sequence of actions, and persistence. It is more useful to identify what actually differs: a value within the same operation, an algorithm with the same promise, or a separate product scenario.

Consider two fictional sites: a workshop journal and a catalogue of learning materials. Both display cards for records available to the reader. The journal has a short list of recent additions; the catalogue has a larger editorial selection and its own curriculum approval process. This is a conceptual analysis of product differences: the data below is neither the configuration of a finished application nor the result of a completed migration.

Three changes, three different decisions

First, describe the differences without class names. Each needs a clear effect for the reader and an owner of the decision. If the description starts with “add a flag”, it has already skipped the choice of boundary.

Difference Journal Catalogue Decision in this example
Page size 12 cards 24 cards A validated configuration value
Order of available records Newest first An editorial sequence Two strategies for one ordering contract
Curriculum approval No such scenario Its own roles, transitions, and decision history An extension of the specific project

The first row changes a quantity. The second changes how an ordered result is obtained. The third introduces new actions and product state. Putting all three differences in one configuration file is technically possible, but it does not give them the same meaning.

The table records a decision under these requirements. If another product later needs approval, it becomes a candidate for a separate shared mechanism. The prospect of that reuse alone is insufficient to require every site to support an empty copy of someone else’s process today.

A value changes scale while preserving meaning

Page size is configuration while the operation still means the same thing: return a bounded portion of available cards in a defined order. Its type, bounds, and behaviour when omitted need to be specified. For example, allow an integer from 1 to 50 and use 12 as the default. This is a choice for the teaching model, not a universal pagination rule.

A page heading can be data too. Changing the name should not silently select a different query or broaden access. Symfony lets values be centralised as parameters and passed to services, as shown in its configuration documentation. The delivery mechanism does not establish whether the responsibility itself has been chosen well.

A hypothetical description of the journal could look like this:

{
  "page_size": 12,
  "ordering_policy": "recent"
}

This is the data format of our discussion and executes nothing by itself. The ordering_policy field only names an already defined policy. It contains no SQL, arbitrary class name, or program to execute. The configuration reader must know a closed set of supported values.

Validate before the user request

Checking a number’s type is insufficient: a value of 0 or 500 does not meet our agreement. A string is insufficient for a policy too: recnet is a typo, not a request for default sorting. An unexpected value should cause an understandable failure while preparing configuration, instead of silently changing the result.

Symfony Config can describe types, numeric bounds, allowed values, and combination rules. These are capabilities of configuration definition and processing, not a finished implementation of this example. The module’s owner must still state which conditions are valid and why.

When one option requires another, check them together. For example, the curated policy requires a defined source of the editorial sequence. The absence of that source should not be interpreted as permission to quietly display recent additions. A correctly configured policy with an empty permitted input, however, returns a normal empty result. A composition error and a lack of records have different causes.

A default is behaviour as well. If a new release changes 12 to 24, a site without an explicit setting gets a different page. The change therefore requires finding consumers that rely on the old agreement and defining a transition. No edit to a site’s file does not mean no change for its reader.

A strategy must fulfil one promise

Two strategies are needed when the algorithm changes but the meaning of the operation remains the same. In our model, both receive cards already permitted for the request and return their sequence. They do not add hidden records, publish drafts, or alter permissions.

The recent policy orders by time and a stable secondary key. The curated policy uses editorial positions; equal positions also need a defined rule. Cards without an editorial position follow positioned cards and are ordered by a stable key; no input card disappears. Specific tie-breaking rules belong to the contract. The name “arbitrary order” merely passes an unresolved decision to the next consumer.

Configuration and strategy can coexist: the value recent selects an implementation, while the implementation contains the algorithm. Symfony can supply a specific service for an interface through explicit composition, as described in the service container documentation. The shared scenario receives a dependency instead of guessing the site from its domain.

It is important not to overstate the common ground. If one implementation only orders prepared cards while another performs searches, checks access, and starts approval, a common interface name conceals different operations. Refine the contract or separate the tasks, rather than compensating for the difference with more optional arguments.

A new process stays with its product

Curriculum approval is not a kind of sorting. It has participants, permitted transitions, reasons for refusal, and its own history. The workshop journal should not need to know these concepts just to display its cards.

In this example, the catalogue adds its own approval scenario to its composition. After a permitted transition, it may change a record’s state through a defined operation. Shared card reading works with visibility that has already been established. The boundary does not automatically make the data consistent: the relationship between a transition and visibility needs its own description and verification during implementation.

A sign of a poor extension is a shared module asking for the product name to decide whether it needs an approver. A better starting point is for the product to connect its own scenario and dependencies. An absent process then means an absent capability, rather than a dozen disabled parameters that another site must understand.

Check the valid combinations

A short table of observable behaviour is useful for acceptance. It defines criteria for a future implementation; the rows below are not a report of executed tests.

Input or change Expected behaviour
page_size is 24 The same operation with a different permitted limit
page_size is 0 Configuration validation rejects it
An unknown ordering_policy An explicit error without a silent fallback
curated without a position source Composition fails before serving the list
The policy is configured and the permitted input is empty An empty result without changing the policy
The journal does not connect approval Its reading scenario needs none of those dependencies

There is no need to check every theoretical combination of independent flags if the model replaces them with a single mutually exclusive choice. Every permitted policy and its significant boundaries still need clear criteria. Fewer parameters help when they remove meaningless states, rather than merely hiding them inside a string.

When to stop adding another setting

Before adding an option, state what will remain unchanged. If the answer is the result type, permissions, and action sequence, a validated value may be enough. If the promise stays the same but the algorithm differs, an explicit strategy is needed. If participants, the lifecycle, or the meaning of success changes, consider a separate project scenario.

This is not a mechanical test based on class counts. A small product can begin with a simple local solution and refine the boundary when a second real need appears. Preserve the explanation: who owns the difference, how it is selected, which values are valid, and what change a consumer will notice.

Good configuration lets a product make an understandable choice. When explaining a new value requires recounting someone else’s business process, that choice already needs a different place in the system.

  1. Symfony Core Dependency Injection in practice: changing the notification method without changing the use case
  2. Architecture When a shared capability is ready to leave the project
  3. Symfony Core Two profiles, one contract: testing the boundary of reuse
  4. Architecture Product catalog and journal: where reuse must end