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

implement the creational builder pattern #3

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

Conversation

CelinaAssal
Copy link
Owner

@CelinaAssal CelinaAssal commented Aug 12, 2021

Problem

Currently, run.py is quite large, making it difficult for developers to understand it at first look. Building an object within this file only adds to the complexity, which goes against coding best practices.

Solution

A solution to this is to apply the creational design pattern of builder. The builder pattern is the most efficient solution to this problem as it allows the creation of an object that has several working parts, of which each part needs to come together to create one single object.

How?

I have created the file multisim_run_builder.py which creates a run object through using the builder pattern. In this file, I have the IBuilder class, which contains the necessary methods for the run object. The Product class then creates the object. The Builder class then builds the object. And finally, the Director class which runs each method.

@CelinaAssal CelinaAssal force-pushed the creational-builder-pattern branch from bfb77e4 to 2de23bc Compare August 15, 2021 00:11
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