background preloader

Design Patterns and Architecture

Facebook Twitter

Are Helper Classes Evil? - Inside Architecture. First off, a definition: A helper class is a class filled with static methods. It is usually used to isolate a "useful" algorithm. I've seen them in nearly every bit of code I've reviewed. For the record, I consider the use of helper classes to be an antipattern. In other words, an extraordinarily bad idea that should be avoided most of the time. What, you say? Avoid Helper Classes!?! I say: they are nearly always an example of laziness. Why laziness? Because most of us in the OO world came out of the procedural programming world, and the notion of functional decomposition is so easy that we drop to it when we come across an algorithm that doesn't seem to "fit" into our neat little object tree, and rather than understand the needs, analyze where we can get the best use of the technology, and place the method accordingly, we just toss it into a helper class.

So what is wrong with helper classes? So let's look at a helper class on the basis of these principles. Now for the fun ones: A Learning Guide To Design Patterns. Design Patterns: Elements of Reusable Object-Oriented Software: Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides: 0785342633610: Amazon.com. Design Patterns | Object Oriented Design. Design Patterns. In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design.

A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Uses of Design Patterns Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. Often, people only understand how to apply certain software design techniques to certain problems. In addition, patterns allow developers to communicate using well-known, well understood names for software interactions.

Creational design patterns These design patterns are all about class instantiation. Structural design patterns These design patterns are all about Class and Object composition. Behavioral design patterns Criticism. .NET Design Patterns in C# and VB.NET - Gang of Four (GOF) - DoFactory. Design patterns are solutions to software design problems you find again and again in real-world application development. Patterns are about reusable designs and interactions of objects.

The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral (for a complete list see below). To give you a head start, the C# source code for each pattern is provided in 2 forms: structural and real-world.

A third form, .NET optimized, demonstrates design patterns that fully exploit built-in .NET 4.5 features, such as, generics, attributes, delegates, reflection, and more. Object oriented - Design pattern and best practices.