Skip to content
CONTEXT MAPPER
  • Docs
  • Language Reference
  • Generators
  • News
  • Background
  • Get Involved
    Introduction
    • Welcome
    • Getting started
    • Create CML Project
    • Examples
    • Usage as Library
    • Frequently Asked Questions
    Language Reference (Core)
    • CML Reference - Introduction
    • Language Semantics
    • Context Map
    • Bounded Context
    • Domain and Subdomain
    • Domain Vision Statement
    • Partnership
    • Shared Kernel
    • Customer/Supplier
    • Conformist
    • Open Host Service
    • Anticorruption Layer
    • Published Language
    • Responsibility Layers
    • Knowledge Level
    • Aggregate
    • Tactic DDD Syntax
    • Application and Process Layer
    • User Requirements
    • Stakeholders
    • Value Registers
    • Imports
    Analysis and Design Transformations
    • Rapid Object-oriented Analysis and Design
    • Story Splitting (PoC)
    • Stakeholder and Value Modelling Transformations
    Architectural Refactorings (ARs)
    • Architectural Refactorings
    • AR-1: Split Aggregate by Entities
    • AR-2: Split Bounded Context by Features
    • AR-3: Split Bounded Context by Owner
    • AR-4: Extract Aggregates by Volatility
    • AR-5: Extract Aggregates by Cohesion
    • AR-6: Merge Aggregates
    • AR-7: Merge Bounded Contexts
    • AR-8: Extract Shared Kernel
    • AR-9: Suspend Partnership
    • AR-10: Change Shared Kernel to Partnership
    • AR-11: Change Partnership to Shared Kernel
    Value-Driven Analysis and Design
    • Value-Driven Analysis and Design (VDAD) Support
    Service Cutter
    • Context Map Suggestions with Service Cutter
    • Service Cutter Configuration File (.servicecutter.yml)
    Reverse Engineering
    • Context Map Discovery
    Generators
    • Generators Overview
    • Context Map Generator
    • PlantUML Generator
    • BPMN Sketch Miner Generator
    • MDSL (Micro-)Service Contracts Generator
    • Service Cutter Generators
    • Generic Generator (Templating)
    Tutorials
    • Model Event Storming Results in Context Mapper
    • Event Sourcing and CQRS Modeling in Context Mapper
    • Generate Microservices From Context Map Using JHipster
    • Systematic Service Decomposition with Context Mapper and Service Cutter
    • Validating the Implementation against the Model (with ArchUnit)
    IDE Plugins and Extensions
    • Visual Studio Code Extension
    • Online IDE (no longer supported)
    • Eclipse Plugin
    • Feature Support

    AR-4: Extract Aggregates by Volatility

    Extracts all aggregates from a bounded context by a given volatility, or likelihood for change (RARELY, NORMAL or OFTEN), and moves them to a separate context.

    Context & Rationales

    By decomposing a system into multiple bounded contexts we aim for loose coupling between the bounded context and a high cohesion within them. One approach of decomposing components is to isolate parts which are likely to change.

    See also:

    • Coupling criterion Structural Volatility of ServiceCutter
    • On the criteria to be used in decomposing systems into modules by D. L. Parnas

    In the Context Mapper DSL you can specify how often an aggregate changes with the likelihoodForChange attribute. See our page aggregate documentation page for more details.

    Goal

    This Architectural Refactoring (AR) extracts all aggregates with a given volatility which is provided as input parameter (RARELY, NORMAL or OFTEN) and moves those aggregates into a new bounded context. Thereby you are able to isolate aggregates with a certain likelihood for change in one bounded context. This AR can be applied if your model exhibits a bounded context with aggregates which have different likelihoods for change.

    Inverse AR’s:

    • AR-7: Merge Bounded Contexts

    Preconditions

    • The selected bounded context must contain at least two aggregates.
    • The aggregates of the selected bounded context must have different likelihoods for change.

    Input

    • One bounded context.

    Output

    • Another bounded context containing all the aggregates with the selected volatility.

    Example

    The following example illustrates how this AR can be applied. The corresponding sources can be found in our examples repository.

    Input

    The bounded context in this example contains one aggregate which changes OFTEN, whereas the other aggregates have a likelihood for change of NORMAL (default value). The AR is available on the bounded context:

    Extract Aggregates by Volatility Example Input

    Selection Dialog

    After triggering this refactoring, a dialog pops up on which you can choose by which volatility value you want to extract:

    Merge Bounded Contexts Example Dialog

    Note that you can only select volatility values which at least occur once in your Bounded Context. The selection of a value which does not occur would not extract anything.

    Result

    The resulting model contains a new bounded context with the aggregate which is likely to change (OFTEN):

    Extract Aggregates by Volatility Example Output

    Example Sources

    • You can find the CML sources for this AR example here.
    Improve this page on GitHub
    ← PreviousAR-3: Split Bounded Context by Owner Next →AR-5: Extract Aggregates by Cohesion
    © 2026 Context Mapper contributors
    • GitHub
    • Get Involved
    • Background & Publications
    • RSS