Skip to content

Conversation

@ajmcquilkin
Copy link
Collaborator

@ajmcquilkin ajmcquilkin commented Nov 14, 2023

Refactoring Meshtastic Firmware from Inheritance to Composition

Proposal Text

Summary

The Meshtastic firmware currently heavily utilizes an inheritance pattern of OOP. This RFC proposes to migrate the firmware from this inheritance pattern to a composition pattern. Perceived benefits of this approach can be found in the Motivation section.

Examples of inheritance being used within the Meshtastic firmware are listed below:

One point to note is that C++ doesn't have an explicit interface keyword, meaning contracts are declared as shown below:

In this context, inheritance is where a superclass contains methods from a subclass, which is not the case in the two lines directly above. An example of this can be found here.

@ajmcquilkin ajmcquilkin self-assigned this Nov 14, 2023
@ajmcquilkin ajmcquilkin added the firmware Related to the firmware repository label Nov 14, 2023
caveman99
caveman99 previously approved these changes Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

firmware Related to the firmware repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants