How pablo1n7/bottlegram works
Main Components
• Baseline Package: Represented by the BaselineOfBottlegram.package. It is used to define how the various parts come together through Metacello, the package management system in Pharo.
• Core Component: Bottlegram-Core.package includes the essential functionalities to interact with the Telegram Bot API. This package is the heart of the library, managing API requests and responses.
• Example Component: Bottlegram-Example.package provides sample implementations (such as the EchoBottle example). This demonstrates how to subclass from the core to build a functioning bot.
• Exception Handling: Bottlegram-Exceptions.package encapsulates any error or exception-related logic, ensuring that the system can gracefully manage errors from the API or user actions.
• External API: Although not “in the file tree,” do include an external component symbolizing the Telegram Bot API, which the core communicates with.
Relationship and Interactions Between Components
• The Baseline package acts as an orchestrator: it is the entry point that organizes and loads the other packages.
• Bottlegram-Core is the primary layer that directly interacts with the Telegram Bot API. It exposes API calls, manages requests, and processes responses.
• Bottlegram-Example uses the Core’s functionality by extending it (creating subclasses, registering commands, and implementing domain-specific logic).
• Bottlegram-Exceptions works as a support module, catching and handling errors that may be raised in both the Core and Example layers.
Important Architectural Patterns and Design Principles
• Modularity: The separation into multiple packages (Core, Example, Exceptions) reinforces a modular design, where each element is responsible for a specific aspect of the overall functionality.
• Inheritance and Extensibility: Using subclassing (as shown in the EchoBottle example) allows developers to easily extend or customize behavior.
• Loose Coupling: By separating concerns (interaction with the API, handling of errors, example usage), the design encourages loose coupling between packages.
Relevant Technologies and Frameworks
• Pharo: The language and environment where the library runs.
• Metacello: The Pharo package management system used to load the baseline.
• Telegram Bot API: The external service that the Bottlegram Core communicates with.