Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application of Builder pattern for report creation #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Damian-Steiger
Copy link

Covidify generates reports and each report may be different internally, since the number of graphs, countries of interest, and other fields can change. Given Covidify’s prevalence of report generation, and the nature of report objects, this flow was the perfect candidate for a builder pattern

Builder adds a layer of separation between the construction and representation of complex objects. Then it is easy to design different representations of the object while using the same construction process. In short, the builder pattern is helpful when building an object takes many steps, and the object can be represented in different ways. For example, building a house might use the method buildWall(), along with many other methods, however the number of walls per house will vary.

My reasons for the application of the builder pattern, as well as my reasons for my choice of implementation, are twofold; flexibility and organization.

…ve their own objects which are created and populated with a builder, allowing for the production of different reports using the same construction process. Now complex report objects can be indepent from their parts and their assembly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant