Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

1.3KB

Title: Bus-01 Date: 2024-01-04 00:00 Category: News Slug: bus-01 Lang: en

On the way to portable code

To gain code portability, we have to divide whole code into two parts:

  • repeatable: logic
  • unique: environment

To simplify portable code construction, we want to be able to place any code - both repeatable and unique - without hierarchy requirements of operating systems. Bus design pattern seems to be the best option. The Bus makes all code chunks equal because they interact through the Bus only.

Bus-01

Currently we have:

Module structure:

Module's YML

Part of the visual representation:

Visual representation

Main functionality:

  1. Format input to leave only digits
  2. Activate the button when at least 3 digits are present
  3. Simulate loading when pressing the button

This was an example of a single instance of an entity.

Next we're going to deal with multiple instances of an entity.