iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
88.22k stars 26.18k forks source link

Refactor Layered Architecture #2976

Open iluwatar opened 4 weeks ago

iluwatar commented 4 weeks ago

Description

Layered Architecture example has some code smells.

CakeInfo - 'Optional' used as type for field 'id' CakeLayerInfo - 'Optional' used as type for field 'id' CakeToppingInfo - 'Optional' used as type for field 'id'

Acceptance Criteria

ankurnotwarikoo commented 3 weeks ago

Willing to work on this. However in my sts I am unable to see the code smells as such. Followed the instructions mentioned here :- https://github.com/iluwatar/java-design-patterns/wiki/12.-IDE-instructions

image Could only see identation issues as such. Please let me know how do I proceed to resolve this. P.S. - Interested to contribute to this repo !

iluwatar commented 3 weeks ago

Don't know about other IDEs, but in IntelliJ IDEA you can reproduce the warnings by using command 'Analyze - Inspect Code' on the layered-architecture module.

ankurnotwarikoo commented 3 weeks ago

Could you assign this issue to me? This is my first time contributing, so I also need some guidance on how to commit and raise a pull request. Thank you!

iluwatar commented 3 weeks ago

Sure @ankurnotwarikoo Here are a couple of good starting points to get started with Github and this project:

ankurnotwarikoo commented 3 weeks ago

@iluwatar - I am done with the code fixes. However, format the code using checkstlye plugin in Intellij and hence unable to surpass the validation of code. Do let me know if there's some checkstyle.xml on which defines the basis of formatting of file.

iluwatar commented 3 weeks ago

Checkstyle is configured here: https://github.com/iluwatar/java-design-patterns/blob/master/pom.xml#L334-L356

It uses built-in Google Checks. We have added some of our own rule suppressions.

IDE instructions have some hints on how to work with Checkstyle https://github.com/iluwatar/java-design-patterns/wiki/12.-IDE-instructions

iluwatar commented 3 weeks ago

Noticed that we have a partly duplicate issue https://github.com/iluwatar/java-design-patterns/issues/2936