Abstract
When we looked at the Decorator design pattern, we saw the different ways of enhancing the functionality of an object. The Proxy design pattern is similar, but its goal is generally to preserve exactly (or as closely as possible) the API that is being used while offering certain internal enhancements.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Not that it matters for this particular example, but this implementation is not thread-safe. Imagine two threads that both do a null check, pass it, and then both assign bitmap one after another – the constructor will be called twice. This is why we use System.Lazy, which is thread-safe by design.
- 2.
You can get it from NuGet; the source code is at https://github.com/ekonbenefits/impromptu-interface.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2020 Dmitri Nesteruk
About this chapter
Cite this chapter
Nesteruk, D. (2020). Proxy. In: Design Patterns in .NET Core 3. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-6180-4_13
Download citation
DOI: https://doi.org/10.1007/978-1-4842-6180-4_13
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-6179-8
Online ISBN: 978-1-4842-6180-4
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)