---
title: "7. Multi-Component Architecture"
path: "/developers/scrypto/07-multi-component-architecture"
version: "1.1.0"
author: "Hydrate"
createdAt: "2026-02-19T06:44:49.042Z"
updatedAt: "2026-03-16T18:21:36.292Z"
---

# 7. Multi-Component Architecture

<Infobox>
| **Multi-Component Architecture** |
| Pattern Type | Application Architecture |
| Difficulty | Intermediate |
| Concepts | [Blueprints & Packages](/contents/tech/core-concepts/blueprints-and-packages), Composition |
| Official Docs | [Scrypto Design Patterns](https://docs.radixdlt.com/docs/scrypto-design-patterns) |
| Catalog | [Blueprint Catalog](https://www.radixdlt.com/blog/build-defi-dapps-faster-on-radix) |
</Infobox>

## Introduction

[Scrypto](/developers/legacy-docs/updates/roadmap/scrypto/scrypto) separates the concept of "smart contract" into two distinct things: [blueprints](/contents/tech/core-concepts/blueprints-and-packages) (reusable templates) and **components** (live instances on the ledger). This separation enables a modular architecture where small, well-tested [blueprints](https://docs.radixdlt.com/docs/blueprints-and-components) are composed into larger systems — much like how object-oriented programming uses classes and composition. The official [Scrypto Design Patterns](https://docs.radixdlt.com/docs/scrypto-design-patterns) documentation recommends this approach as the default for non-trivial dApps.

## Separation of Concerns

Instead of building a monolithic blueprint, decompose your dApp into small [blueprints](https://docs.radixdlt.com/docs/blueprints-and-components) with a single responsibility:

- **TokenSale** — handles pricing and token distribution

- **Treasury** — manages collected funds, fee withdrawal

- **AccessControl** — issues and manages [badges](/developers/scrypto/03-authorization-and-badges)

- **PriceFeed** — wraps an [oracle](/developers/infrastructure/03-oracle-integration) and exposes prices to other components

Each blueprint is easier to test in isolation, reason about for security, and audit independently. Smaller blueprints are also more reusable — a Treasury blueprint can serve a DEX, a lending protocol, or a DAO with no changes.

### Inter-Component Calls

Components call each other's methods using their on-ledger address. A component can store another component's address in its state and invoke methods on it:

```
struct MyDapp {
    treasury: Global<Treasury>,
    price_feed: Global<PriceFeed>,
}

impl MyDapp {
    pub fn buy(&mut self, payment: Bucket) -> Bucket {
        let price = self.price_feed.get_price("XRD/USD");
        // ... calculate tokens owed ...
        self.treasury.deposit(payment);
        // ... return tokens ...
    }
}
```

## Blueprint Reuse & the Catalog

Radix encourages sharing blueprints as published packages that anyone can instantiate. The [Blueprint Catalog](https://www.radixdlt.com/blog/build-defi-dapps-faster-on-radix) concept allows developers to find, audit, and reuse existing blueprints rather than reimplementing common patterns.

### Importing External Blueprints

To use a blueprint from another package, import it by its package address and instantiate or call it. The [Scrypto](/developers/legacy-docs/updates/roadmap/scrypto/scrypto) `extern_blueprint!` macro generates type-safe bindings:

```
extern_blueprint! {
    "package_rdx...",       // on-ledger package address
    PriceFeed {             // blueprint name
        fn get_price(&self, pair: String) -> Decimal;
    }
}
```

This generates a type you can use in your component's state and method signatures, with full compile-time type checking.

### Factory Pattern

A common pattern for dApps that create multiple similar components (e.g. a DEX creating liquidity pools): write a **factory blueprint** whose instantiation function creates and configures child components, returning their addresses and any admin [badges](https://docs.radixdlt.com/docs/authorization).

## External Links

- [Scrypto Design Patterns — Official Docs](https://docs.radixdlt.com/docs/scrypto-design-patterns)

- [Blueprints and Components — Official Docs](https://docs.radixdlt.com/docs/blueprints-and-components)

- [Blueprint Catalog: Build DeFi dApps Faster — Radix Blog](https://www.radixdlt.com/blog/build-defi-dapps-faster-on-radix)

- [Reusable Blueprints Pattern — Official Docs](https://docs-babylon.radixdlt.com/main/scrypto/design-patterns/reusable-blueprint-pattern.html)