Bringing Plausible Deniability to Development: the Strategy Pattern
This is where the strategy pattern comes into play. You can use a simple interface that defines your payment strategy to streamline your code and cut down on the number of decision points. All you really need is a block of code that looks at the payment record and decides what strategy to use. The other code should be the same regardless of the payment type.
The Template Pattern A Benevolent Dictator
This is an extremely useful pattern for avoiding code duplication and keeping code maintainable. As programmers we know that whenever we are copying and pasting the same, or nearly the same, logic across code we should really be encapsulating that code to prevent drift.
Developer Tip Quickly look up table information in SQL Server Management Studio
You are working on a SQL query joining some tables when you need to know more about one of your tables … you could open another query window and run “sp_help tbUserGroup” OR you can just select the table and hit ALT F1 to do the same thing!
StrictMock vs. DynamicMock: What are You Testing Here Anyway?
Well, there’s nothing to think about here is there? If this is the way you want to write tests, invest some time and write a tool that will parse your test and create your business object for you. The test tells you “use the factory, create an adder, call the add method on the adder and return the result. Where’s the fun in that? What are you actually testing? Does it really matter how the calculator does what it needs to do?
