Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC for Refactoring Firmware from Inheritance to Composition Pattern #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ajmcquilkin
Copy link
Member

@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