Vítor Azevedo
1 min read12 hours ago

--

Thank you for your feedback! The SOLDIER principle is not an industry-standard like SOLID but rather a set of guidelines that emphasize simplicity, clarity, and adaptability in software design. While SOLID principles focus on object-oriented design patterns, SOLDIER is more about keeping code lightweight, maintainable, and domain-aligned—especially in frameworks like Angular where modularity and separation of concerns play a crucial role.

Regarding your points:

1. Simple vs. Lightweight – While they may seem similar, *Simple* focuses on writing clear, direct code, while *Lightweight* emphasizes reducing unnecessary overhead. For example, a simple function can still be inefficient if it introduces unnecessary dependencies.

2. Using a Service for HTTP Requests – I completely agree that separating concerns is a best practice. The intent of the example was to show how avoiding unnecessary abstraction can sometimes lead to more readable code, but I appreciate the suggestion to reinforce the importance of dedicated services for HTTP requests.

3. Singleton Violation – Good observation! The provided example of using `providers: [UserService]` creates a new instance at the component level, which can be useful for scenarios where component isolation is required. However, for global state and shared services, using a singleton at the module level (`providedIn: 'root'`) is generally the better approach. I’ll consider refining this explanation to clarify when each approach is suitable.

While SOLID principles are foundational and widely adopted, SOLDIER provides a complementary perspective—one that encourages pragmatic simplicity and modularity in frontend development. Again, I appreciate your insights and will take them into account for future refinements! 🚀

--

--

Vítor Azevedo
Vítor Azevedo

Written by Vítor Azevedo

Frontend Developer with 25+ years' expertise in HTML, CSS, JavaScript, Angular and Vue. Builds dynamic, user-centric web apps. Award-winning projects.

Responses (1)