Skip to content

(Abstract Factory) Add factory of factories#665

Merged
iluwatar merged 4 commits into
iluwatar:masterfrom
Tschis:master
Nov 20, 2017
Merged

(Abstract Factory) Add factory of factories#665
iluwatar merged 4 commits into
iluwatar:masterfrom
Tschis:master

Conversation

@Tschis
Copy link
Copy Markdown
Contributor

@Tschis Tschis commented Nov 8, 2017

The explanation for the pattern mentions that it is "a factory of factories", but the example does not have any factory class that returns the concrete classes of KingdomFactory.

This commit removes the direct instantiation of ElfKingdomFactory and OrcKingdomFactory from App.main() and delegates their creation to a new (factory of factories) FactoryMaker inner class of App.

Even though the pattern itself does not necessarily need this, it helps to synchronize the explanation text with the coding example, making it easier to understand that statement.

@Tschis
Copy link
Copy Markdown
Contributor Author

Tschis commented Nov 8, 2017

Sorry, I had problems with the checkstyle on the first commit. I have since configured it properly and made changes (3634b33) to my code so that it would follow the style guidelines.

After that I had troubles with the correct command for running the maven checkstyle, so I needed an extra commit (933c84f).

My code is now running locally with build success on
install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -e

Copy link
Copy Markdown
Owner

@iluwatar iluwatar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good in general. Can you also revise the explanation text in README.md so it is in sync with the new code?

@Tschis
Copy link
Copy Markdown
Contributor Author

Tschis commented Nov 19, 2017

Done, @iluwatar

@iluwatar iluwatar merged commit 4450000 into iluwatar:master Nov 20, 2017
@iluwatar
Copy link
Copy Markdown
Owner

Thank you @Tschis for this improvement, much appreciated 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants