@@ -60,17 +60,18 @@ The final program must work as a unified cohesive experience.
6060- Service: Execution layer, use cases, orchestration logic.
6161- Core: Definition of entities, validation, data structures; Does not depend on anything.
6262
63- Ideally dependencies should flow inward, in practice this is achieved by extensive use of interfaces.
64- Interfaces add overhead and they are not always needed. Usually I will have injection of raw implementation
65- (without interface) because of that .
63+ Ideally dependencies should flow inward (gateway depends on service, service depends on core),
64+ in practice this is achieved by extensive use of interfaces. Interfaces add overhead and they
65+ are not always needed .
6666
6767#### Design Patterns
6868
6969- Strategy Pattern: Used to handle multiple bootloader and initramfs tools. The Service layer
7070 chooses the right strategy at runtime based on system capabilities and configuration.
71+ - Factory Pattern: To allow for inversion of dependency. For example define the interface of
72+ how a step is created in core layer (internal/core/step_factory.go), and then implement on service
73+ layer (internal/service/step_factory.go).
7174- Pipeline Pattern: Each step (list, download, compile, etc.) is encapsulated as a modular
72- component. The Pipeline Manager in the Service layer coordinates step dependencies and execution order.
73- - Builder Pattern: A flexible way to assemble the kernel build configuration step-by‑step,
74- culminating in a unified kernel build process.
75- - Facade Pattern: Provides a simplified interface (a unified kernel context) to coordinate the
76- flow of commands across multiple steps.
75+ component (step). The pipeline runs validation and execution separately.
76+ - Builder Pattern: Flexible way to assemble step-by‑step the pipeline, choosing exacly the steps
77+ needed and coordenating and resolving dependencies.
0 commit comments