Back to Blog
Software

When Adding One Status Value Requires a Deployment: Designing Common Code Tables and Code Management for Business Systems

If adding one status value takes a code change and a deployment, your code values are scattered through the source. This guide covers what to manage as common codes, how to design the tables, how to make code changes safe, and how to use codes in the application.

POLYGLOTSOFT Tech Team2026-11-257 min read15
Common CodeCode Table DesignBusiness SystemData ModelingMaintenance

What Happens When Code Values Are Scattered Across the Source

Suppose someone asks you to add an "On Hold" order status. If status values are hardcoded, you have to update the dropdowns on the list, detail, and reporting screens one by one, find and change every branch that checks the status, then test and deploy. The change itself might take half a day. Once you fit it into a release window, it can easily take one to two weeks to reach production.

Systems like this tend to show the same symptoms:

  • The same "order status" field has different options, in a different order, on each screen
  • Comparisons like `if (status == "03")` are spread across dozens of places, and without a comment nobody knows what "03" means
  • Flag columns mix 'Y/N', '1/0', and 'T/F' from one table to the next
  • What Belongs in Common Codes and What Doesn't

  • Common codes: classification values such as order status, defect type, or return reason. They have a handful to a few dozen entries and simple attributes
  • Master data: customers, items, and equipment have many records and their own attributes (business registration numbers, specs, and so on). They belong in dedicated tables
  • Common codes also come in two kinds:

  • System codes: business logic branches on these values. For example, inventory is deducted when an order reaches "Shipped." If an operator changes them freely, the logic breaks, so they are managed together with code changes
  • Display codes: values such as inquiry types that are only used for classification and reporting. Operators can add these from an admin screen
  • Designing the Common Code Tables

    The basic design has two levels, groups and codes:

  • Code group: group ID (`ORDER_STATUS`), name, description, system-code flag
  • Code: group ID + code value (composite key), display name, sort order, active flag, valid-from and valid-to dates
  • If you number sort orders 10, 20, 30, you can insert a new entry between two others without renumbering the rest.

  • Hierarchical codes: model parent-child relationships, such as defect type → root cause, with a parent code column. Past three levels, consider a separate classification table
  • Multilingual labels: `name_ko` and `name_en` columns are enough for two languages. If more languages are coming, move labels into their own table
  • Extra attributes: attributes that differ by group, such as "customer at fault" for return reasons, go into extension columns like `attr1` through `attr5`. Record what each column means in the group definition
  • Safeguards for Code Changes

  • Deactivate instead of delete: if you delete a code that past orders still reference, their labels show up blank. If you only clear the active flag, the code drops out of input dropdowns while historical records still show their labels. This is why code lookups for input and for display are kept separate
  • Approval and history: require approval for system code changes, and log the old and new values, the user who made the change, and when it happened, for every change
  • Environment sync: ship system codes with the application as migration scripts. For display codes, treat production as the source and pull them down to development
  • Using Codes in the Application

  • Caching: common codes rarely change, so cache them in server memory and invalidate the cache when someone saves on the admin screen. With multiple servers, also set a short expiry of about 5–10 minutes
  • A shared dropdown component: if a component like `` takes only a group ID and handles the options, ordering, and language, screens stop drifting apart
  • Validate branch codes against constants and the database: define values used in branching as constants such as `OrderStatus.SHIPPED`, and check at application startup that every one of them exists in the database. A missing value then shows up at startup instead of in production traffic
  • The POLYGLOTSOFT Approach

    It is safer to clean up legacy code values in stages. As a maintenance (SM) improvement project, POLYGLOTSOFT recommends this sequence:

  • Survey the source and database to list every hardcoded value and code column
  • Group codes that mean the same thing, and separate system codes from display codes
  • Build the common code tables and admin screen, then switch the dropdowns to the shared component first
  • Move branch codes into constants and add startup validation
  • If adding a single status value still means booking a release, it's time to review how you manage codes. POLYGLOTSOFT supports this work through our subscription development and maintenance services, from consolidating common codes in a live business system to building the admin screens. Tell us about your current system, and we'll work out the scope and order of the cleanup with you.