Open shreyass-ranganatha opened 1 year ago
Proposal for Refactoring Gitscribe to an Object-Oriented Approach with DDD Principles Hi @shreyass-ranganatha ,
I would like to propose a refactor of the Gitscribe codebase to adopt an object-oriented approach while incorporating Domain-Driven Design (DDD) principles. This will help us create a more maintainable, scalable, and robust architecture. Here are the key points:
Refactor Discord Bot: Create a DiscordBot class to encapsulate all functionalities, enhancing modularity and flexibility.
Refactor GitHub API: Introduce classes for different entities (e.g., Repository, Issue) based on DDD principles to ensure that our code aligns with the business domain and improves clarity.
Domain Model Creation: Develop a domain model that accurately reflects the core concepts and relationships within the project, facilitating better collaboration and understanding among team members.
Explore Alternatives: Consider using established GitHub API wrappers (like PyGithub or Github3.py) and evaluate the benefits of transitioning to the GitHub GraphQL API for more efficient data retrieval.
I believe these changes will greatly benefit the project. I’d love to discuss this further and align on the refactoring strategy. Thank you for considering!
The GitHub REST API implementation
gitscribe/apis/github.py
and the Discord Botgitscribe/_discord.py
are all currently implemented in a functional programming paradigm. Although a welcoming point for beginners, it can be extremely limiting when expanding the project. Let's make use of what Python is great at and refactor the codebase to an object-oriented approach.Checkpoints:
gitscribe/_discord.py
should define aDiscordBot
class instead of having a pre-definedbot
object which is the current implementation.gitscribe/apis/github.py
should have different classes forRepository
,Issue
, etc.requires discussion:
scripts/gitscribe
Should build an object of the newDiscordBot
class and run it from withinRef: #23