Null Object Pattern in C#

October 30th, 2009

A Null object is an object that encapsulates the absence of an object. It provides the do nothing behavior and returns the defaults. The Null object is used whenever object reference would have been null. The use of Null Object pattern simplifies the client code and makes it less error prone.

Sajad Deyargaroo

http://www.codeguru.com/csharp/.net/net_general/patterns/article.php/c16503/

UI Patterns: User Interface Design Pattern Library

April 5th, 2009

It has long been common practice to use recurring solutions to solve common problems. Such solutions are called design patterns; standard reference points for the experienced user interface designer. This website seeks to better the situation for the UI designer, who struggles with the same problems as many other UI designers have struggled with before him.

This site will help you in two ways: You can read insightful design pattern articles or browse through our screenshot collection.

Finally, you can help your fellow peers by uploading your own screenshots of great user interfaces.

Anders Toxboe

http://ui-patterns.com/

Blurring of MVC lines: Programming the Web Browser

November 29th, 2008

When HTML first came out, browsers could have been called “Application Thin Clients”, if the buzzword had been in use at the time. The introduction of javascript made it possible to execute code on the client, and this turned browsers into something much more than just a “display” mechanism.

Before Javascript, Web application development was simple: everything was done server-side. The concept of MVC - Model View Controller - was easy: the HTML was generated, and that was the view. With Javascript being a full-blown programming language, the lines are being blurred between which code is responsible for the View, the Controller and even the Model. The resultant split of responsibility across client and server in wildly diverse programming languages is driving many developers to alternative technologies such as Flash, and causing headaches for those Web developers who remain.

The key components of the solution - to allow the developer to create MVC applications in a single programming language, where at least the “View” source is extracted and compiled to Javascript and HTML - actually exist and are used in production environments, thanks to Google Web Toolkit and Pyjamas. RubyJS is well on the way, too.

Luke Kenneth Casson Leighton

http://advogato.org/article/993.html

Patterns of persistence

April 23rd, 2008

Although many developers use object-relational mapping (ORM) tools for their applications’ persistence tier, some are confused about how to use them and duplicate code unnecessarily. The authors’ experience constructing many persistence tiers has given them a clear understanding of persistence patterns and best practices. The first part of this two-part article covers the basics of a consistent, concise domain model and persistence tier.

Ryan Senior
Travis Klotz
Jim Majure

http://www.ibm.com/developerworks/java/library/j-pop1/?S_TACT=105AGX01&S_CMP=HP

PHP in Action: Objects, Design, Agility

January 24th, 2008

Despite being perhaps the most popular Web language in use, PHP has for much of its history been criticized for not offering the full capabilities of object-oriented programming (OOP). But with the released of version 5, PHP introduced a robust object model, and made it easier for its proponents to create well-architected Web sites and applications. In turn, the new OOP capabilities have facilitated additional best practices, such as design patterns, test-driven development, continual refactoring, and HTML templates. These topics and more are explored in the book PHP in Action: Objects, Design, Agility.

Michael J. Ross (reviewer)

http://books.slashdot.org/books/08/01/23/1446243.shtml

A Theory of Programming

November 26th, 2007

No list of patterns, no matter how exhaustive, can cover every situation that comes up while programming. Eventually (or even frequently) you’ll come upon a situation where none of the cookie cutters fits. This need for general approaches to unique problems is one reason to study the theory of programming. Another is the sense of mastery that comes of knowing both what to do and why. Conversations about programming are also more interesting when they cover both theory and practice.

Kent Beck is the author of Implementation Patterns, from which this article is adapted.

http://www.ddj.com/architect/204201170

Implementation Patterns

October 31st, 2007

I am pleased to announce the release of Implementation Patterns. The book explains how to write code that communicates well with other humans. A chapter in the back explains an alternative style to use if you are writing frameworks instead of applications. The examples are all in Java, although the principles and most of the patterns apply to languages in the same family.

The book connects with XP’s values. Writing code that communicates with other people is a way of demonstrating that you value communication. Writing code that communicates is respectful to others. The book also connects with principles like maximizing the option value of software and writing code one can be proud of.

Kent Beck

http://www.informit.com/titles/0321413091

Ajax and XML: Five Ajax anti-patterns

August 13th, 2007

You can learn a lot about how to do things correctly by understanding how things are done incorrectly. Certainly, there’s a right way and a wrong way to write Asynchronous JavaScript + XML (Ajax) applications. This article discusses some common coding practices you will want to avoid.

Jack D Herrington

http://www.ibm.com/developerworks/xml/library/x-ajaxxml3/

Wiki Patterns

June 29th, 2007

There is no ‘right’ way to use a wiki. The fantastic thing about wikis, and the reason they have been so successful, is that they are built from the ground up by the people who use them. That way, the structure of a wiki, and how it is used, comes to mirror how the people using the wiki want to structure it, how they want to use it.

One of the most common misconceptions about patterns are that they are somehow recipes. With that misunderstanding, you would read this site as a list of instructions: how to set up initial content, how to encourage people to contribute, how to deal with disruptive elements.Wikipatterns is not an instruction manual, it’s a set of tools. It’s examples of techniques that have helped people, and of situations that people have found themselves in that they wished they hadn’t. We want to help to identify a nail, and know you might want to hit it with a hammer.

http://www.wikipatterns.com/

The Software Patterns Blog

April 12th, 2007

I am pleased to broadcast the launch of a new blog called the software pattern blog. This blog belongs to the editors of IJOP, columnists, staff, advisory, editorial and domain expert boards, external reviewers, and to those who have been specially invited. It is an open forum which is managed by Dr. M. E. Fayad and his associates.

This blog focuses on software patterns, stable analysis and design patterns, architectural patterns, pattern languages and how to develop systems of patterns. The objective of this blog is to foster mature discussions about issues that affect all software developers and practitioners nowadays.

Eduardo M. Segura

http://pattern.ijop.org/

Counting Array Elements at Compile Time

March 9th, 2007

Ivan presents a new type-safe way to write COUNTOF so that it produces a compile-time error if you accidentally pass it to anything other than the built-in array. The traditional way to find the number of elements in an array in C++ has been to calculate it using the sizeof operator. Sometimes the sizeof expression is wrapped in a macro to make it more readable. In this article, I present a new type-safe way to write COUNTOF so that it produces a compile-time error if you accidentally pass it a pointer, std::vector, or anything else other than the built-in array.

Ivan J. Johnson

http://www.ddj.com/…

Ajax and XML: Five common Ajax patterns

March 9th, 2007

Asynchronous JavaScript + XML (Ajax) was certainly the technology buzzword of 2006 and looks to do just as well or better in 2007. But what does it really mean for your application? And which common architectural patterns are used widely in Ajax applications? Discover five common Ajax design patterns that you can use as a basis for your own work.

Jack D Herrington

http://www-128.ibm.com/developerworks/xml/library/x-ajaxxml2/index.html

Use Inversion of Control in Method Signatures

February 23rd, 2007

The Inversion of Control (IoC) pattern is normally used for components. This article describes how to use the pattern on method signatures to decrease the coupling between components and improve performance. IBM Global Business Services consultant André Fachat uses two examples to show the flexibility of this approach.

Inversion of Control (IoC) and Dependency Injection (DI) are patterns that draw a lot of attention. They are mostly used within so-called IoC containers, which inject dependencies into a component in the form of other components. However, the patterns don’t define the design of these dependency components’ methods. In a classic design, value objects or data transfer objects in those methods are used as method parameters and return values when complex objects are required.

This article shows you that you can also use IoC on the method signatures to decouple the methods from the value objects. You do this by replacing the value objects in the method signatures with interfaces. I show you scenarios where this approach can be useful. I use this pattern frequently and find that it helps me better separate the concerns between the components. And in the runtime, it reduces object-creation and copying efforts.

André Fachat

http://www-128.ibm.com/developerworks/java/library/j-ioc/