January 2017
Intermediate to advanced
314 pages
6h 42m
English
The decorator pattern attaches additional responsibilities to an object dynamically. The inheritance is always not feasible, because it is static and applies to an entire class. Decorators provide a flexible alternative to sub-classing for extending functionality. The pattern helps add behavior or state to individual objects at runtime. The .NET Framework uses decorators in the case of stream processing classes. The hierarchy of stream processing classes are as follows:
System.IO.StreamSystem.IO.BufferedStreamSystem.IO.FileStreamSystem.IO.MemoryStreamSystem.Net.Sockets.NetworkStreamSystem.Security.Cryptography.CryptoStreamThe following code snippets show how one can use FileStream to read contents from an operating ...
Read now
Unlock full access