-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Here's a list of 10 most common embedded software architectures
Out of those, we chose sparq to follow primarily the layered architecture however, it contains some ideas that resemble hexagonal architecture(ports and adapters pattern) because the HAL layer is made of interfaces and the PAL layer provides the concrete implementations behind those interfaces. But it is not a true hexagonal architecture
PAL contains the concrete implementations to HAL's interfaces/abstractions and application layer consumes those interfaces in it's business/application logic:
Application
│
▼
HAL
│
▼
PAL
│
▼
OS / SDK / Hardware
This is the textbook definition of a layered architecture with abstraction layers
Hexagonal architecture (Ports & Adapters) usually looks like:
Adapter
│
▼
Port(interface)
│
▼
Application/Core
▲
│
Port(interface)
▲
│
Adapter
The key idea is:
The application/core owns the interfaces (ports) and the outside world implements them
In a true hexagonal design:
class IMotor
{
public:
virtual void Move(...) = 0;
};would belong to the application/core domain, not to a HAL layer and that's why this is not a hexagonal architecture, only looks like it
So conceptually HAL reminds of ports, while PAL reminds of adapters, but structurally the system is still organized as layers rather than as a hexagon around a domain core, so I would call it:
Layered architecture with dependency inversion and interface-based abstractions