-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Module pattern #62 #512
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
Module pattern #62 #512
Conversation
FirstCut++
SecondCut++
checkstyle errors removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@inbravo looks good in general. I added some review comments. Please comment when you're done with the changes and we can proceed with merge.
@@ -0,0 +1,95 @@ | |||
/** | |||
* The MIT License Copyright (c) 2016 Amit Dixit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please retain the license header consistent e.g. The MIT License Copyright (c) 2014 Ilkka Seppälä
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
public final class App { | ||
|
||
public static FileLoggerModule fileLoggerModule = null; | ||
public static ConsoleLoggerModule consoleLoggerModule = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are initialized to null automatically. Check for similar occurrences elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
|
||
/* Prepare modules */ | ||
fileLoggerModule.prepare(); | ||
consoleLoggerModule.prepare(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be possible to create the object and prepare it on one line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method prepare() is independent to demonstrate modular aspect of pattern. Please clarify.
* the creation and organization of other elements, and groups them as the structural pattern does. | ||
* An object that applies this pattern can provide the equivalent of a namespace, providing the | ||
* initialization and finalization process of a static class or a class with static members with | ||
* cleaner, more concise syntax and semantics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not duplicate this comment everywhere. It could be only in App.java
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
* @throws IOException if program is not able to find log files (output.txt and error.txt) | ||
*/ | ||
@Test | ||
public void positiveTestFileMessage() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would reconsider JUnit test method naming. See the other patterns for examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@inbravo is this ready for another review? |
Your third comment on module/src/main/java/com/iluwatar/module/App.java, require clarification. Kindly advise. |
@inbravo yes, so instead of this
You could write
|
Code is Done! as per all review comments ..... |
Well done @inbravo 👍 Thank you for the new pattern! |
@all-contributors please add @inbravo for code |
I've put up a pull request to add @inbravo! 🎉 |
Pull request for Module pattern #62