What is the difference between Facade and Gateway design patterns?

Reviewing Facade in the GoF book and the link in another answer to Martin Fowler’s Gateway, it appears that their focus is in opposite directions. Facade provides a simple uniform view of complex internals to (one or more) external clients; Gateway provides a simple uniform view of external resources to the internals of an application. … Read more

Strategy Pattern V/S Decorator Pattern

The strategy pattern allows you to change the implementation of something used at runtime. The decorator pattern allows you augment (or add to) existing functionality with additional functionality at run time. The key difference is in the change vs augment In one of the questions you linked to it also points out that with the … Read more

What’s the point of the Prototype design pattern?

The prototype pattern has some benefits, for example: It eliminates the (potentially expensive) overhead of initializing an object It simplifies and can optimize the use case where multiple objects of the same type will have mostly the same data For example, say your program uses objects that are created from data parsed from mostley unchanging … Read more

Decorator pattern versus sub classing

from Decorator pattern at wikipedia The decorator pattern can be used to make it possible to extend (decorate) the functionality of a certain object at runtime. The whole point of decorator pattern is to dynamically add additional behaviour/functionality, which is of course not possible at design time. from the same article: The decorator pattern is … Read more

Design patterns: exception / error handling

These patterns and best practices are often bound to a specific platform/language, so they are the first place to look for them. Exception patterns wiki is a general patterns resource. As an example check the following links for java: Best Practices for Exception Handling 15 Best practices about exception handling Exception-Handling Antipatterns Going through such … Read more

How to use log4net with Dependency Injection

I think you’re not seeing the forest for the trees here. ILog and LogManager are a lightweight façade almost 1:1 equivalent to Apache commons-logging, and do not actually couple your code to the remainder of log4net. <rant> I’ve also found that almost always when someone creates a MyCompanyLogger wrapper around log4net they miss the point … Read more