I have a system structured out. It works exactly as I want it to work, but I'm curious if I'm using the right naming conventions for the structures involved.
Base classes:
Report
classes: Encapsulates criteria for querying data from the database. Also uses the database connection to fetch its base data.Document
class: Represents a file (Excel, PDF, etc.) with filesystem, filename/url, etc.ReportDocument
class: Extension ofDocument
contextualized for aReport
DocumentFactory
class: Creates the appropriateDocument
based on need.
Structural classes:
DocumentStrategy
classes: Handles the actual saving mechanism while being worked on (saving to temp based on needs defined by whatever library handles the saving) and informs theDocument
where it's located in the temporary filesystem.ReportHydrator
classes: Specific Hydrators for specific Reports and Strategies with a definedhydrate
method that receives some kind of handle from the Strategy, which the Hydrator uses to do more specific processing (i.e. an Excel strategy establishes a base spreadsheet, but the Hydrator writes specific data to specific cells)
Is there a better way of naming these structures? Should I move around responsibilities of these at all?
Aucun commentaire:
Enregistrer un commentaire