Skip to content

Conversation

hbothra15
Copy link
Contributor

Static factory method

  • Earlier factory was returning new Object whenever it was called to provide the child Object, now this has been replaced to provide object from static collection, this in turns help in reduction of memory foot-print, for example we ask factory method to provide Elf's Axe for Five times, earlier it used to generate 5 different object and return, now it will return Single object for each call.
  • This will help in reduction of memory foot of the application

Pull request description

  • Describes the main changes that come with the pull request
  • Any relevant additional information is provided

For detailed contributing instructions see https://github.com/iluwatar/java-design-patterns/wiki/01.-How-to-contribute

Copy link
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.

Build is failing due to checkstyle errors

@iluwatar
Copy link
Owner

@hbothra15 some changes were requested

@hbothra15
Copy link
Contributor Author

Yes @iluwatar,
Will get this done by tomorrow

@iluwatar
Copy link
Owner

Let me know when it's ready for another review

@hbothra15
Copy link
Contributor Author

It's ready for your review

Comment on lines 98 to 99
System.out.println(clazz);
System.out.println(weapon);
Copy link
Owner

Choose a reason for hiding this comment

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

Either remove these console printouts or use proper logger

@hbothra15
Copy link
Contributor Author

Changes has been made and updated the README.md file to be aligned with new code

@iluwatar iluwatar merged commit cdb80b8 into iluwatar:master Oct 30, 2019
@iluwatar iluwatar added this to the 1.22.0 milestone Oct 30, 2019
@iluwatar
Copy link
Owner

Thanks a lot @hbothra15 👍

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