Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Decorator pattern


Related Topics

In the News (Thu 12 Nov 09)

  
  three-ten software | innovation through education
The object to be decorated is passed as an input parameter to construct a new decorated object.
The template method pattern is very similar to the strategy pattern in that it also allows events to occur in the middle of a call to a method, rather than before or after.
The filter pattern is a version of the decorator pattern which is used to manipulate data steams.
webwerks.ca /threeten/decorator_overview.htm   (243 words)

  
 Design Pattern Synopses
The Filter pattern is a special case of the Decorator pattern, where a data source or data sink object is wrapped to add logic to the handling of a data stream.
The Composite pattern also allows the objects in the tree to be manipulated in a consistent manner, by requiring all of the objects in the tree to have a common superclass or interface.
The Flyweight pattern is often combined with the Composite pattern to represent the leaf nodes of a hierarchical structure with shared objects.
www.mindspring.com /~mgrand/pattern_synopses.htm   (4381 words)

  
 GoF Design Pattern::Structural::Decorator   (Site not responding. Last check: 2007-10-22)
The Decorator pattern can adds and removes functionality to individual objects dynamically and transparently by using an instance of a subclass of the original class that delegates operations to the original objects.
Both the Decorator pattern and the Proxy pattern use a level of indirection when accessing an object, and both implementation contains a reference to another object to which they forward requests.
However, Proxy pattern is not designed for recursive composition and is not concerned with adding or removing of responsibility dynamically, but rather, serves as a surrogate for another object.
pages.cpsc.ucalgary.ca /~chi/SENG/609_04/DecoratorSummary.html   (563 words)

  
 The Decorator Design Pattern
The Decorator Pattern is used for adding additional functionality to a particular object as opposed to a class of objects.
Decorators add the ability to dynamically alter the behavior of an object because a decorator can be added or removed from an object without the client realizing that anything changed.
It is a good idea to use a Decorator in a situation where you want to change the behaviour of an object repeatedly (by adding and subtracting functionality) during runtime.
exciton.cs.rice.edu /JavaResources/DesignPatterns/DecoratorPattern.htm   (355 words)

  
 The Decorator Pattern   (Site not responding. Last check: 2007-10-22)
The Decorator design pattern allows is a mixture of the composite and strategy design patterns (it can alternately be viewed as the strategy design pattern in reverse).
It is easy to see how the decorator pattern is a backwards strategy pattern: while in the strategy pattern, some client object contains a strategy which it calls, in the strategy pattern, the client object is contained in a decorator, which calls it.
The decorator pattern is useful in situations similar to the strategy pattern, when subclassing is not appropriate for adding functionality to a class (for instance, when different functionalities must be added to different instances of a class).
www.cs.rice.edu /~arudys/comp410/decorator.html   (387 words)

  
 Decorator   (Site not responding. Last check: 2007-10-22)
Both the decorator objects and the core object inherit from this abstract interface.
Note that this pattern allows responsibilities to be added to an object, not methods to an object's interface.
Composite and Decorator have similar structure diagrams, reflecting the fact that both rely on recursive composition to organize an open-ended number of objects.
home.earthlink.net /~huston2/dp/decorator.html   (545 words)

  
 Lasagne/J and the Decorator Pattern
The motivating example of the Decorator pattern is a graphical user interface toolkit, that lets you add properties like borders or behaviors like scrolling to any user interface component by enclosing the component in another objects that add the border or the scroll capability.
Decorating is simply done by having the Decorator class forwarding draw requests to its component, and let the Decorator subclasses extend this operation.
The decorator code is dynamically superimposed by a generic wrapper on the methods of the decorated object.
www.mip.sdu.dk /~bnj/LasagneJ/Lasagne_J_Decorator_DP.htm   (698 words)

  
 Decorate your Java code
Decorators add functionality either before or after forwarding to the object they decorate; for example, our line number reader tracks the current line number as it reads from an input stream.
Decorators extend the decorated class (or implement the decorated interface), which lets decorators masquerade as the objects they decorate.
That instance is the object that the decorator decorates.
www.javaworld.com /javaworld/jw-12-2001/jw-1214-designpatterns.html   (1214 words)

  
 Modelling & Design Patterns
Decorators can be nested thus providing the capability to add and remove a variety of additional functionalities, possibly dynamically.
In a similar manner, the decorator 1 is contained inside decorator 2 which, before relaying on a request for operation() executes the addittional code code 2 and so on.
Decorators should be added before the server is passed on to the client, or if done later, the client should re-request the server.
www.csm.uwe.ac.uk /~pcsmarti/uqc822hm/lect2.htm   (909 words)

  
 Decorator   (Site not responding. Last check: 2007-10-22)
Strategy pattern, which changes the guts of an object, whereas a decorator changes the skin of an object.
Facade pattern, which provides a way of hiding a complex class, whereas a decorator adds function by wrapping a class.
We create a decorator class that adds a text to the Number object to indicate that such number is a random number.
www.javacamp.org /designPattern/decorator.html   (243 words)

  
 ONJava.com: Using the Decorator Pattern
The main difference between subclassing and the Decorator pattern is this: with subclassing, you work with the class, whereas in the Decorator pattern, you modify objects dynamically.
With the Decorator pattern, however, you apply changes to each individual object you want to change.
As a result, the decorator is now a child component of the container.
www.onjava.com /pub/a/onjava/2003/02/05/decorator.html   (679 words)

  
 Decorators
In particular, the Decorator pattern is useful for extending the functionality of a class without polluting (or even needing) the original source.
A decorator is, in fact, a second distinct class whose interface must be maintained in concert with the class it decorates.
Decorators change the appearance of an object in a way that is fundamentally different from subclassing.
www.stevenblack.com /PTN-Decorator.asp   (1227 words)

  
 Simon Dyck Seng 609.04 Decorator Pattern Summary   (Site not responding. Last check: 2007-10-22)
The Decorator Design Pattern is used when additional functionality needs to be added to objects dynamically.
Decorators would seem to be especially useful when you wish to add functionality in cases where you do not even have the source code.
A confusing aspect for me is that the decorator is a subclass of the component class that it decorates.  It is counterintuitive because the instance is a parent of the component it decorates.
sern.ucalgary.ca /~sdyck/courses/seng609.04/decorator.html   (337 words)

  
 [No title]
The other object is the component, it is the decorated object.
The decorator conforms to the interface of the enclosed component and so its presence is transparent to the components clients.
The decorator forwards requests to the component, but may perform some processing before/after doing so.
io.uwinnipeg.ca /~rmcfadye/3913/DecoratorPattern.ppt   (108 words)

  
 SENG 609.04
Design pattern provides a solution to a problem that occurs over and over again within a specific context and by identifying the patterns in the software design, it allows us to reuse the same structure on similar problems and also help software developers to communicate more efficiently through a common knowledge.
A Decorator must conform to the interface of the component and because of this regulation; the Decorator is also transparent to the component.
The Decorator pattern only changes the skin of a component, which means that the component doesn't have to know anything about its Decorators.
www.ucalgary.ca /~samulee/seng60904/paper.html   (1956 words)

  
 Knowing and Doing: Patterns Archives
Patterns are no longer the hot buzzword -- they are a couple of generations of buzzwords beyond that -- which changes how conferences in the area need to be run.
Relating these patterns in a pattern language builds a rich context around the patterns and gives instructors a way to think about designing their instruction and implementing their ideas.
The decorator pattern is cool and all, but until you feel what not using it is like in some situations, it's sometimes hard to see the point.
www.cs.uni.edu /~wallingf/blog/archives/cat_3.html   (16989 words)

  
 New Page 1   (Site not responding. Last check: 2007-10-22)
By using the Decorator pattern, it is possible to "attach additional responsibilities to an object dynamically" (Gamma, et al.
Instead of adding functionality to an entire class of objects by subclassing an object, by using the Decorator Pattern, it is possible to add functionality to a single object during runtime.
Tables are implemented in Java using the MVC design pattern: a model maintaining the data, a view that displays the data and a controller responsible to react to the user events.
www.enel.ucalgary.ca /~cervatiu/609_04/week2.htm   (654 words)

  
 SENG 443: Decorator Design Pattern
By enclosing the original component in another object, the decorator object, additional characteristics can be added to the component while conforming to the original interface and leaving the original class unchanged.
The decorator pattern maintains transparency, allowing the design pattern to be used recursively in the addition of an unlimited number of properties.
The Decorator is a concrete instance of the abstract class and indistinguishable from other concrete instances, such as other decorators, allowing the discrete recursive nesting of decorators and an infinite number of modifications.
pages.cpsc.ucalgary.ca /~huynha/definition.htm   (291 words)

  
 Decorator Design Pattern   (Site not responding. Last check: 2007-10-22)
This Decorator pattern is based on the Decorator pattern as described in [Gam+, pages 175..184].
The decorator conforms to the interface of the text stream it decorates so that it’s presence is transparent to the text stream’s clients.
The decorator forwards requests to the text stream it decorates and may perform additional actions (such as buffering or scrambling the text) before or after forwarding.
www.castle-cadenza.demon.co.uk /decorate.htm   (887 words)

  
 C# Design Patterns: The Decorator Pattern   (Site not responding. Last check: 2007-10-22)
In order to decorate a button, the Decorator has to be an object derived from the visual environment so it can receive paint method calls and forward calls to other useful graphic methods to the object it is decorating.
In this case, we decorate it by drawing fl and white border lines to highlight the button or gray lines to remove the button borders.
Design Patterns further suggests that classes such as Decorator should be abstract classes and that you should derive all of your actual working (or concrete) Decorators from the Abstract class.
www.awprofessional.com /articles/article.asp?p=31350   (743 words)

  
 Java theory and practice: Decorating with dynamic proxies
While all of these patterns can be easily implemented using ordinary classes instead of dynamic proxies, in many cases the dynamic proxy approach is more convenient and compact and can eliminate a lot of handwritten or generated classes.
The Proxy pattern involves the creation of a "stub" or "surrogate" object, whose purpose is to accept requests and forward them to another object that actually does the work.
Proxy-based implementations of these patterns are easy to write, harder to get wrong, and lend themselves to greater genericness; in many cases, one dynamic proxy class can serve as a Decorator or Proxy for all interfaces, rather than having to write a static class for each interface.
www.ibm.com /developerworks/library/j-jtp08305.html   (2354 words)

  
 Bradshaw and Whelan British - porcelain books, ceramic books, pottery books, marks   (Site not responding. Last check: 2007-10-22)
To help readers determine the age of their George Jones wares with accuracy, registration dates for many of the patterns and ceramic shapes are provided, along with the various manufacturer's marks and their dates of usage.
Over 350 further illustrations are included, covering the shapes of the ware found decorated with printed designs, Spode marks found on the ware and the methods of manufacture used in the past and those practised today.
Flow Blue and other transfer print decorated wares produced from 1880 to 1925 by the potters of England's famous Staffordshire pottery district are illustrated in over 740 color images and line drawings, along with the pottery body shapes and the manufacturers' marks.
www.ceramicbooks.com /british.htm   (7739 words)

  
 Pattern Summaries 6: Adapter and Decorator
As mentioned at the beginning of this article, the decorator pattern is structurally similar to the Adapter pattern but differs greatly in the intent.
We conclude this discussion of the Decorator pattern with a code example that implements some of the door controller classes shown in diagrams at the beginning of this discussion.
The basic intent of the Decorator pattern is to extend the behavior of objects.
www.developer.com /tech/print.php/10923_629081_2   (874 words)

  
 Jeremy D. Miller -- The Shade Tree Developer : Dynamic Behavior with the Decorator Pattern
One slick alternative I've seen is to use the Decorator pattern to create a new IDataReader class that wraps the underlying reader just to intercept the null values and substitute a default value.
A lot of the elegance of the decorator pattern is the ability to add extra behavior to a class without creating subclasses.
Clint spawned a thought in my head regarding usage of patterns, specifically in reference to "Today I was just looking at Decorator and was thinking that man, there must be somewhere that I can use this." I do that as well, and I think it's the wrong way to approach the study of patterns.
codebetter.com /blogs/jeremy.miller/archive/2005/09/02/131613.aspx   (2048 words)

  
 Three approaches for decorating your code
A decorator is something or somebody who decorates something or (maybe) somebody.
The inheritance type of Decorator implementation is not as simple as it first appears.
In many cases, we don't know what kind of decorators we'll need for the future; as a result, using this type of implementation will prove difficult for extension and conflicts with object-oriented design principles.
www.javaworld.com /javaworld/jw-04-2004/jw-0412-decorator.html   (761 words)

  
 Exceptions with Decorator Pattern
I used the Decorator Pattern in order to implement two Java Idioms concerning Exceptions.
I used the Decorator Pattern for creating two Decorators to the Java Native Exception class.
One decorator adds the Name of the Class originating the exception, and the other adds the Exception Msg.
www.geocities.com /CollegePark/Library/4275/decorator.html   (220 words)

  
 Quilting encyclopedia - s, t, u
The sashing is often cut from a solid color or tone-on-tone fabric so its pattern does not interfere with the design of the quilt blocks.
Satin stitch - The satin stitch is a decorative stitch that often is used to border appliqueed pieces.
Templates - Templates are patterns that you use to cut out your fabric for piecing.
www.learnhowtoquilt.com /stu.html   (1364 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.