Renderer Rewrite vs New - SC-SGS/surviving-sarntal GitHub Wiki

Renderer - Rewrite vs New

Context and Problem Statement

The current project utilizes Flecs with an Entity-Component-System (ECS) architecture. Our team lacks experience with ECS, having primarily worked with Object-Oriented Programming (OOP). As a result, we decided to document our architectural decision to rewrite the entire Renderer in OOP rather than converting the existing ECS-based renderer.

Problem Statement

We need to decide whether to rewrite the existing ECS-based renderer using OOP principles or to develop an entirely new Renderer from scratch.

Considered Options

  • Rewrite the ECS-based Renderer in OOP
  • Develop a New Renderer from scratch in OOP

Pros and Cons of the Options

Rewrite the ECS-based Renderer in OOP

Refactor the existing renderer to use OOP, transforming its ECS-based design.

  • Good, because it allows us to retain some of the existing functionality and design
  • Good, because it might reduce development time compared to starting from scratch
  • Good, because it allows gradual transition, minimizing the learning curve for the team
  • Bad, because it may lead to a complex and less coherent design due to mixed paradigms
  • Bad, because potential hidden dependencies and complexities in the existing code could arise
  • Bad, because it might still require significant effort to fully understand and refactor the existing ECS code

Develop a New Renderer from Scratch in OOP

Create a new Renderer using OOP principles, starting from a clean slate.

  • Good, because it ensures a clean, consistent design tailored to our needs
  • Good, because it leverages the team's familiarity with OOP, leading to more efficient development
  • Good, because it avoids the complexities and potential pitfalls of refactoring existing ECS code
  • Good, because it provides an opportunity to incorporate modern design patterns and best practices from the start
  • Bad, because it requires more initial development time compared to refactoring
  • Bad, because it involves discarding existing functionality and starting anew, which might lead to missing features initially

Decision Outcome

Chosen option: Develop a New Renderer from Scratch in OOP, because it allows us to create a clean and maintainable codebase from the beginning. This approach aligns with our team's expertise and ensures that the project structure is easily understandable, extendable, and maintainable. Although this option requires more initial development effort, it offers long-term benefits in terms of code quality and team productivity.

⚠️ **GitHub.com Fallback** ⚠️