Skip to Content
Visual Basic Design Patterns: VB 6.0 and VB.NET
book

Visual Basic Design Patterns: VB 6.0 and VB.NET

by James W. Cooper
November 2001
Intermediate to advanced
512 pages
9h 10m
English
Addison-Wesley Professional
Content preview from Visual Basic Design Patterns: VB 6.0 and VB.NET

Chapter 18. The Decorator Pattern

The Decorator pattern provides us with a way to modify the behavior of individual objects without having to create a new derived class. Suppose we have a program that uses eight objects, but three of them need an additional feature. You could create a derived class for each of these objects, and in many cases this would be a perfectly acceptable solution. However, if each of these three objects requires different features, this would mean creating three derived classes. Further, if one of the classes has features of both of the other classes, you begin to create complexity that is both confusing and unnecessary.

For example, suppose we wanted to draw a special border around some of the buttons in a toolbar. If ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Visual Basic 2008

Programming Visual Basic 2008

Tim Patrick
Visual Basic 2015 Unleashed

Visual Basic 2015 Unleashed

Alessandro Del Sole

Publisher Resources

ISBN: 0201702657Purchase book