Null Object Design Pattern

Category: Python - Education

This script is a sample implementation of the 'Null Object' design pattern. Roughly, the goal with Null objects is to provide an 'intelligent' replacement for the often used primitive data type None in Python or Null (or Null pointers) in other languages. These are used for many purposes including the important case where one member of some group of otherwise similar elements is special for whatever reason. Most often this results in conditional statements to distinguish between ordinary elements and the primitive Null value. Date: 25 February, 2012


Null Object - Design Pattern - Object Design - Null - Object - Design

Homepage: http://code.activestate.com/

Developer: code.activestate.com

License: Freeware

Operating System: All

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

Memento design pattern in python script allows you to cache instances based on what arguments are passed to them.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This code implements the policy design pattern in Python by using metaclasses and multiple inheritance.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script presents a design pattern that is highly reusable.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Singleton design pattern implementation in ruby.

developer Developer: snippets.dzone.com
license License: Freeware
operating systems Operating System: Windows, Linux


This class implements the observer design pattern.

developer Developer: code.activestate.com
license License: Artistic License, GNU General Public License (GPL)
operating systems Operating System: Windows, Linux, Mac OS, BSD, Solaris


Take an instance (call it foo) and create a factory class (call it InstanceFactory) that produces foo's.

developer Developer: Daniel Cohn
license License: Freeware
operating systems Operating System: Windows


This recipe builds on two previously posted recipes for a null or dummy object by modifying a few methods (e.

developer Developer: George Sakkis
license License: Freeware
operating systems Operating System: Windows


Discrete Cosine/Sine Transformations script is a Python implementation of discrete Cosine/Sine transformations.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Konig's theorem tells us that every bipartite graph with maximum vertex-degree d can be edge-colored with just d colors.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All