http://blog.steveklabnik.com/posts/2012-09-01-random-ruby-tricks--struct-new
Ruby has the Struct construct which author makes use of to "reify" objects to be more Object Oriented. In Java, we'd have to create a separate class for these tiny strongly typed data objects, e.g. by using the "parameter object" pattern.
Tuesday, October 11, 2016
Saturday, July 23, 2016
Refactoring for SOLID
I read the two articles below on refactoring and SOLID principles.
In the OOP section of the above article, the interesting takeaway is the encapsulation of logic in a "policy" class which is used along "doer" classes to be invoked and thus abstract away and remove cyclomatic complexity from methods.
This one lends credence to the notion of the "large set of small classes" to abide by the Single Responsibility Principle. The emphasis is on composition of behavior, and using seams or interfaces to swap out or extend (by using decorators) existing behaviors to add new features.
Wednesday, July 13, 2016
Util Classes and OOP
Suggestions on how to refactor: http://www.yegor256.com/2014/05/05/oop-alternative-to-utility-classes.html
https://lostechies.com/chrismissal/2009/06/01/anti-patterns-and-worst-practices-utils-class/
https://lostechies.com/chrismissal/2009/06/01/anti-patterns-and-worst-practices-utils-class/
Monday, July 11, 2016
Using Spring Mock for TDD
http://chatley.com/blog/2006/01/testing-controllers-with-mocks.html
Illustrates quick iterative test-first development using MockHttpServletRequest.
Illustrates quick iterative test-first development using MockHttpServletRequest.
Friday, July 8, 2016
End to End tests and Unit tests
on E2E vs unit: http://googletesting.blogspot.com/2015/04/just-say-no-to-more-end-to-end-tests.html
Pointed out "gold standard" of unit testing in guava, i.e. https://github.com/google/guava/blob/master/guava-tests/test/com/google/common/base/StopwatchTest.java testing https://github.com/google/guava/blob/master/guava/src/com/google/common/base/Stopwatch.java
Pointed out "gold standard" of unit testing in guava, i.e. https://github.com/google/guava/blob/master/guava-tests/test/com/google/common/base/StopwatchTest.java testing https://github.com/google/guava/blob/master/guava/src/com/google/common/base/Stopwatch.java
Saturday, January 16, 2016
Servlet Filters
Understanding and Using Servlet Filters
On calling doFilter() for pre and post processing around the target servlet service() method.
On calling doFilter() for pre and post processing around the target servlet service() method.
Subscribe to:
Posts (Atom)