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

[Language-related-refactoring] Factory Pattern into the Factory Method Pattern #305

Open
Frosendroska opened this issue Jul 25, 2024 · 1 comment
Labels
refactoring Refactor the project

Comments

@Frosendroska
Copy link
Contributor

Frosendroska commented Jul 25, 2024

Description

More description is in the PR comment.

Every [Something]Factory class that we have often contains a single method createSomething. We can turn the Factory Pattern into the Factory Method Pattern.

These createSomething static methods can be moved into the base abstract classes/interfaces (e.g., in this case we can place createTestBodyPrinter() static method into TestBodyPrinter interface (and maybe rename to just create()). This will allow us to remove a single entity from the codebase, namely TestBodyPrinterFactory. It'll reduce the code complexity.

In TestBodyPrinterFactory, TestCompilerFactory and TestSuiteParserFactory

@Frosendroska Frosendroska added the refactoring Refactor the project label Jul 25, 2024
@Frosendroska Frosendroska self-assigned this Jul 25, 2024
@Frosendroska
Copy link
Contributor Author

Some of this factories are used not only on one class.

For example, TestCompilerFactory is used in TestSparkStarter, TestCasePanelFactory and in LLMProcessManager, therefore we need to have an extra entity for it.

For other classes it could happen that we will need them in other places as well, so having the Factory abstraction is crucial

@Frosendroska Frosendroska removed their assignment Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactor the project
Projects
None yet
Development

No branches or pull requests

1 participant