# Abstract module · Chromia Docs (concept)

> Abstract modules and functions allow you to design reusable code components that you can adapt to specific needs within your client modules.

Source: https://docs.chromia.com/rell/language-features/modules/abstract/

# Abstract module

On this page

* [Definition](#definition)
* [Override for customization](#override-for-customization)
* [Example](#example)

Abstract modules and functions allow you to design reusable code components that you can adapt to specific needs within
your client modules.

### Definition

* **Abstract Modules:** Lay the foundation for customization by declaring a module as abstract:

  Rell

  ```
  abstract module;
  ```
* **Abstract Functions:** Outline a function's signature without implementing its body:

  Rell

  ```
  abstract function customize(x: integer): text;
  ```

  It is also possible to supply an implementation that will serve as a default implementation:

  Rell

  ```
  abstract function customize(x: integer): text = "Default";
  ```

### Override for customization

* **Import the Abstract Module:** Bring the abstract module into your client module to access its components:

  Rell

  ```
  import lib;
  ```

  note

  When importing an abstract module, it's crucial to override all its abstract functions that lack a body to ensure a
  fully functional implementation.
* **Override Abstract Functions:** Provide concrete implementations tailored to your specific requirements:

  Rell

  ```
  override function lib.customize(x: integer): text {
      // Your customized implementation here
  }
  ```

### Example

abstract\_vehicle.rellRell

```
abstract module;

abstract function is_4wd(): boolean = false;
abstract function has_four_doors(): boolean;
```

sportscar.rellRell

```
module;

import abstract_vehicle.*;

override function has_four_doors() = false;
```

main.rellRell

```
module;

import sportscar;

// Returns (is_4wd = true, has_four_doors = false)
query sports_car_details() = (
    is_4wd = sportscar.is_4wd(),
    has_four_doors = sportscar.has_four_doors()
    );
```

[View this page on docs.chromia.com](https://docs.chromia.com/rell/language-features/modules/abstract/)Content mirrored from the live docs
