Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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.