Commit Graph
100 Commits
Author SHA1 Message Date
Narendra PathaiandGitHub 0fa18d91c6 Added real world example of Command pattern
JUnit 4 Statement class is also an example of Command pattern. Added that to list of real world examples
2018-12-03 18:58:20 +05:30
Narendra PathaiandGitHub 2aa9e78ddd Minor refactorings and code style changes (#807)
* Made minor changes in some patterns such as removed throws clause where not needed, changed incorrect order of arguments in assertEquals

* Minor refactorings and code style changes. 1) Removed several use of raw types 2) Removed unnecessary throws clauses 3) Used lambda expressions wherever applicable 4) Used apt assertion methods for readability 5) Use of try with resources wherever applicable 6) Corrected incorrect order of assertXXX arguments

* Removed unused import from Promise

* Addressed review comments

* Addressed checkstyle issue
2018-10-23 13:45:41 +05:30
Narendra PathaiandIlkka Seppälä 25ed7c09c5 Refactored Event Queue (#806)
* 1) Test cases were not stopping AudioService before ending test case 2) Changed Audio to be a good singleton, previously because of Audio being bad singleton, test cases which were using static methods could have caused intermittent failures. 3) Made some other refactorings as well

* Removed sonar issue and converted Audio to eager singleton for simplicity

* Updated class diagram PNG
2018-10-21 21:15:33 +03:00
Narendra PathaiandIlkka Seppälä 922fd62da6 Resolves #643, test cases failed due to global state in CallsCount (#803)
* Resolves #643, test cases failed due to presence of global state in CallsCount. Because AppTest was executed before B2BServiceTest, it scheduled 1 sec timer using ThrottleTimerImpl class. While resetting it used that global CallCount class reset() method, which reset all counters. So that causes thread safety issue because of unintended sharing of application state between test cases, which is not a good practice.

* Updated class diagram png and added UCLS file
2018-10-21 21:14:07 +03:00
Narendra PathaiandIlkka Seppälä 9e7a500743 Refactoring changes in Ambassador Pattern (#805)
* 1) Updated test cases to use Junit Assert method as compared to assert keyword 2) Proper testing of RemoteService using RandomProvider interface. Introduced RandomProvider interface so that randomness can be controlled from test cases. 3) For readability used constant for representing FAILURE

* Addressing review comments, Deleting unintentional file and used FAILURE constant in ClientTest as well
2018-10-21 21:12:03 +03:00
Narendra Pathai 829df031c3 Intermittent failure was due to Thread.sleep in the code. While performing unit test cases there was race condition between two threads, so it was not guaranteed to work every time. Used an interface DelayProvider for simulating delay, and while unit testing fake delay provider is used that eradicates the use of Threads in unit test cases, which is not a good practice. 2018-10-15 16:36:27 +05:30
Narendra Pathai 37ae182630 Resolved PMD issues 2018-10-15 13:30:20 +05:30
Narendra Pathai ab2c12e734 1) Refactored LotteryNumbers to use Joiner from guava library to join lottery numbers. 2) Solved potential thread safety issue in LotteryTicketId class, where it was using raw primitive value and incrementing it which is not thread-safe. So used AtomicInteger for brevity 3) assertEquals arguments were in incorrect order at many places, so changed order of those 4) Replaced assertFalse and assertTrue at some places with assertEquals and assertNotEquals for reducing complexity of code 5) Removed public modifiers from test cases, as they are no more needed by JUnit 5 2018-10-15 13:21:00 +05:30
Narendra Pathai 709405d964 Resolved checkstyle issues 2018-09-11 16:11:59 +05:30
Narendra Pathai f3749a2b9d Solved the classcast exception and used instanceof instead. Improved javadocs a bit. 2018-09-11 15:58:14 +05:30
Narendra PathaiandGitHub 9e56e5cbc1 Merge pull request #791 from er2/executeAroundLambda
Execute Around - use lambda
2018-09-09 00:24:42 +05:30
Narendra PathaiandGitHub 1698b066f3 Merge pull request #767 from nikhilbarar/collection-pipeline
#564: Collection Pipeline pattern
2018-09-09 00:21:45 +05:30
Narendra PathaiandGitHub 038befea26 Merge pull request #779 from mitchellirvin/bst-iterator
#778: Binary Search Tree Iterator
2018-08-30 12:46:13 +05:30
Narendra PathaiandGitHub 74f3799eb4 Merge pull request #788 from diffblue-assistant/finallyclosetotrywithresources
Use try-with-resources
2018-08-28 13:17:16 +05:30
Narendra PathaiandGitHub b64262303a Merge pull request #787 from bordoisila1/checkstyle-minor-updates
Fixed minor changes suggested by Checkstyle
2018-08-21 11:20:16 +05:30
Narendra PathaiandGitHub 9d012772fd Merge pull request #785 from sgyyz/fix-image-name
Fix converter image Display Issue
2018-08-21 11:12:40 +05:30
Narendra PathaiandGitHub c7f9266768 Merge pull request #753 from Argyro-Sioziou/master
Acyclic Visitor pattern #734
2018-06-28 13:55:32 +05:30
Narendra PathaiandGitHub d7893c1fc2 Updated incorrect tag
Corrected improper tag from Difficulty-Easy to Difficulty-Beginner
2018-05-16 12:36:17 +05:30
Narendra PathaiandGitHub eddfe76a84 Merge pull request #717 from waisuan/master
Dirty Flag pattern #560
2018-05-16 12:31:20 +05:30
Narendra PathaiandGitHub fb5c2a0324 Merge pull request #642 from piyushchaudhari04/unit-of-work-pattern
#352 - Unit of work pattern implementation
2017-12-04 00:32:49 +05:30
Narendra PathaiandGitHub b2dd175851 Merge pull request #648 from Peter-Morawski/patch-1
added missing whitespace to the elements of the unordered list
2017-10-09 11:00:43 +05:30
Narendra PathaiandGitHub 31120a8fa0 Merge pull request #646 from rastdeepanshu/master
Modifications for intermittent test failure in Throttling pattern.
2017-10-09 10:58:57 +05:30
Narendra PathaiandGitHub 2f33094030 Merge pull request #645 from amitdash291/patch-1
Removed redundant times(1) params for verify()
2017-09-27 10:18:46 +05:30
Narendra PathaiandGitHub 5c1a4f1caf Added example that mocking frameworks use proxy pattern 2016-08-31 16:12:13 +05:30
Narendra Pathai 59cf100302 #403, updated javadocs 2016-08-29 12:04:24 +05:30
Narendra Pathai ad11ea46b1 Work on #403, javadocs updated 2016-08-29 11:55:30 +05:30
Narendra Pathai 5796e1967f Work on #403, updated diagram and finishing touches 2016-08-29 11:50:33 +05:30
Narendra Pathai 483c61a82a Some refactoring, added javadocs 2016-08-29 00:16:36 +05:30
Narendra PathaiandGitHub 6575b3ae99 Merge pull request #491 from alexsomai/patch-1
Minor code changes
2016-08-29 00:00:44 +05:30
Narendra Pathai 95cf9fe367 Work on #403, made example readable and moved methods into utility 2016-08-22 18:43:29 +05:30
Narendra Pathai 28647cdf48 #211, consistent use of real world examples section in all readme files. 2016-08-20 20:57:48 +05:30
Narendra Pathai fdcf546112 Merge branch 'master' of https://github.com/iluwatar/java-design-patterns into DocumentUsages 2016-08-20 20:50:30 +05:30
Narendra Pathai a0c77c32b5 #211 added further examples for structural and behavioral patterns 2016-08-20 20:49:28 +05:30
Narendra PathaiandGitHub eb75773891 Added FAQ on Memento pattern
Difference between java Serialization and Memento pattern added
2016-08-20 19:44:48 +05:30
Narendra Pathai c79df708b1 #211 added real world examples from Java api for creational patterns 2016-08-20 13:17:53 +05:30
Narendra Pathai d484e7f731 Documented singleton double check idiom, explaining the dynamics that happen on each step for better understanding. Did this due to a PR #475 2016-08-05 14:38:25 +05:30
Narendra Pathai 76970633b8 Work on #403, incorporate review changes 2016-08-04 18:10:50 +05:30
Narendra PathaiandGitHub 55028a49dc Merge pull request #476 from sumityadav6541/master
removed extra "is" from javadoc comments
2016-08-04 17:47:37 +05:30
Narendra Pathai e7be94d2e4 Merge branch 'Promise' of https://github.com/iluwatar/java-design-patterns into Promise 2016-07-29 13:12:33 +05:30
Narendra Pathai 383e4a3a0b Merge branch 'master' of https://github.com/iluwatar/java-design-patterns into Promise 2016-07-29 13:01:51 +05:30
Narendra Pathai 40ac552542 Work on #403, added README 2016-07-24 01:45:49 +05:30
Narendra Pathai 09ba5ca656 Work on #403, added class diagrams and javadocs 2016-07-22 18:34:05 +05:30
Narendra Pathai eb560f5f54 Work on #403, removed checkstyle violations 2016-07-22 16:53:01 +05:30
Narendra Pathai 2b945ca27f Work on #403, removed dependency on async method invocation module, added more tests 2016-07-22 16:47:52 +05:30
Narendra Pathai 4bd1f14cfb Merge branch 'master' of https://github.com/iluwatar/java-design-patterns into Promise 2016-07-22 12:52:54 +05:30
Narendra Pathai 102341443d Work on #403, added application class and test cases. 2016-07-21 19:13:42 +05:30
Narendra Pathai ea7503414e Work on #403, added basic implementation of promise pattern 2016-07-20 19:58:20 +05:30
Narendra Pathai 464ae1690b Updated pom 2016-03-28 11:59:29 +05:30
Narendra Pathai ddbc61b140 Incorporated review changes - 1) Created sql file for central schema 2)
Changed getById return type to Optional
2016-03-28 11:55:22 +05:30
Narendra Pathai f32a3892a3 Merge branch 'master' of https://github.com/iluwatar/java-design-patterns into refactor-dao 2016-03-28 11:06:25 +05:30
Narendra Pathai 9074a9ca05 Merge branch 'saifulazad-patch-1' 2016-03-26 15:54:38 +05:30
Narendra Pathai b14aff17b6 Updated failing test cases 2016-03-26 15:54:10 +05:30
Narendra Pathai 20c1e2ea80 Merge branch 'patch-1' of https://github.com/saifulazad/java-design-patterns into saifulazad-patch-1 2016-03-26 15:50:25 +05:30
Narendra Pathai a395316a80 Added readme 2016-03-26 13:54:03 +05:30
Narendra Pathai 80875a9ac8 Removed dependency on Mockito from pom 2016-03-26 12:36:50 +05:30
Narendra Pathai 4d820b12ff Changes after review. Added README 2016-03-26 12:33:02 +05:30
Narendra Pathai e543ee0a9c Merge branch 'master' of https://github.com/iluwatar/java-design-patterns into mute-idiom 2016-03-26 12:11:09 +05:30
Narendra Pathai 3f7ead5ca5 Work on #404, updated class diagram and javadoc. Passed checkstyle checks 2016-03-23 13:13:19 +05:30
Narendra Pathai fa077c8be9 Work on #404, javadocs and test cases for DB and in memory dao. 2016-03-21 17:55:29 +05:30
Narendra Pathai 448d855809 implemented and added test cases for DB dao. Added dependency of Hierarchical junit runner in parent pom 2016-03-18 16:39:45 +05:30
Narendra Pathai f6a20c7693 Refactoring changes to DAO pattern. Renamed default dao implementation to InMemory and refined interface 2016-03-16 18:47:07 +05:30
Narendra Pathai e5217bbde8 Work on #385, added missing license template 2016-03-16 12:48:53 +05:30
Narendra Pathai 40e5c8d587 Merge branch 'master' of https://github.com/iluwatar/java-design-patterns into mute-idiom 2016-03-16 12:41:15 +05:30
Narendra Pathai c78dd2667a Work on #385, added documentation and class diagram. Made refactoring changes to pass checkstyle and PMD checks 2016-03-16 12:40:46 +05:30
Narendra Pathai 7aff77ab27 Used mockito to replicate SQLException while closing connection to show use of loggedMute 2016-03-15 18:44:59 +05:30
Narendra Pathai 414cdfa332 Merge pull request #398 from legka/master
Event driven architecture refactored.
2016-03-09 10:49:08 +05:30
Narendra Pathai adb94044ff Work on #385, created project and provided two mute methods 2016-03-01 17:28:28 +05:30
Narendra Pathai 35d6a54831 Merge pull request #391 from DevFactory/release/Useless-parentheses-around-expressions-should-be-removed-to-prevent-any-misunderstanding-fix-1
squid:UselessParenthesesCheck - Useless parentheses around expression…
2016-02-29 17:53:13 +05:30
Narendra Pathai dfef28e93e Merge pull request #384 from DevFactory/release/Redundant-Field-Initializer-fix-1
pmd:RedundantFieldInitializer - Redundant-Field-Initializer
2016-02-18 12:39:06 +05:30
Narendra Pathai f1122f78e3 Added real life application to Command pattern 2016-02-15 18:21:34 +05:30
Narendra Pathai cd077fa490 Merge branch 'master' of https://github.com/iluwatar/java-design-patterns into FactoryMethodChanges 2016-02-12 15:49:35 +05:30
Narendra Pathai 823dc6395f Merge pull request #376 from DevFactory/release/Classes-without-public-constructors-should-be-final-fix-1
squid:S2974 - Classes without public constructors should be final
2016-02-12 15:44:31 +05:30
Narendra Pathai 221b71781a Resolved checkstyle audit error 2016-02-11 12:29:35 +05:30
Narendra Pathai b5d4445d63 Made example App a bit easier to understand 2016-02-10 17:53:32 +05:30
Narendra Pathai f64ba22c64 1) Removed warning from test case. 2) Made implementation of App more understandable. 2016-02-10 17:38:15 +05:30
Narendra Pathai ab2aad3226 Work on #226, moved pattern specific references to respective patterns. And removed credits section from Home page. 2016-01-27 12:55:59 +05:30
Narendra Pathai ba6511fe5d Work on #226, moved POSA reference and some J2EE design pattern references 2015-09-24 12:23:02 +05:30
Narendra Pathai b3e4e8a47b Work on #226, #213, added references of Gang Of Four to all GoF patterns, added tag for Gang Of Four, added difficulty tags to some of them 2015-09-22 18:25:56 +05:30
Narendra Pathai 570a30099e Some changes to further polish #74 2015-09-16 13:24:21 +05:30
Narendra Pathai e5f1ff1be1 Merge pull request #242 from iluwatar/Reactor
Reactor #74 implemented using Java NIO framework.
2015-09-16 11:45:58 +05:30
Narendra Pathai dbc2acae5f Work on #74, removed author name from all classes. [ci skip]. Author names were added due to default eclipse configuration. 2015-09-16 11:39:57 +05:30
Narendra Pathai e6a4200607 Work on #74, increased coverage 2015-09-15 13:48:58 +05:30
Narendra Pathai 2ff78184e5 Work on #74, added class diagram and index.md 2015-09-14 12:56:17 +05:30
Narendra Pathai 5bacfce727 Merge branch 'master' of https://github.com/iluwatar/java-design-patterns into Reactor 2015-09-14 11:46:18 +05:30
Narendra Pathai 8d429525dc Work on #74, updated javadocs, reformatted code to google style guide, added missing final modifiers 2015-09-12 17:46:24 +05:30
Narendra Pathai aebd69efb4 Work on #74, Merged from master 2015-09-12 15:03:02 +05:30
Narendra Pathai 611a82a33c Merge pull request #245 from iluwatar/design-principles
PR for Document design principles #208
2015-09-12 14:53:05 +05:30
Narendra Pathai 65add323ed Work on #208, explained the ways our patterns can be explored 2015-09-11 13:51:44 +05:30
Narendra Pathai 9ecb1b2546 Work on #184, changed category, added difficulty tag, more real applications and credits, added implementation approaches 2015-09-11 13:24:15 +05:30
Narendra Pathai 338ecd1658 Work on #208, categorized factory method in beginner difficulty tag 2015-09-10 15:26:47 +05:30
Narendra Pathai efa7e01223 #184 polished a few rough edges, class diagram change, and removed warnings 2015-09-10 13:12:36 +05:30
Narendra Pathai 0148cd7d2a Merge pull request #225 from hannespernpeintner/fluentinterface
#184 Fluent Interface pattern
2015-09-10 12:18:28 +05:30
Narendra Pathai 7a1c2ee413 Work on #208, added getting started section in README and linked it to programming priciples site 2015-09-08 12:49:54 +05:30
Narendra Pathai 9e401b0f34 Fixed version number 2015-09-06 14:14:38 +05:30
Narendra Pathai 30f6065195 Removed todo file 2015-09-06 14:10:31 +05:30
Narendra Pathai 57ff154e0a Changed version 2015-09-06 14:09:00 +05:30
Narendra Pathai 0bf2a2fb5d Merged from master 2015-09-06 14:07:13 +05:30
Narendra Pathai 363d2c3845 Work on #74, improved documentation and minor changes 2015-09-06 14:01:29 +05:30
Narendra Pathai 7ac262b880 Work on #74, repackaged and added javadocs 2015-09-04 17:43:01 +05:30
Narendra Pathai 782c0b8320 Work on #226, moved pattern specific credits to respective pattern pages in website 2015-09-03 18:17:07 +05:30