© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
D. NesterukDesign Patterns in .NET 6https://doi.org/10.1007/978-1-4842-8245-8_14

14. Value Object

Dmitri Nesteruk1  
(1)
St. Petersburg, c.St-Petersburg, Russia
 
The decision as to whether to make an object a class or a struct is very important, and not just from the performance perspective. Quite often what we really want is a “value plus” – to be able to provide a wrapper around a single value (such as an int) that would do one of the following:
  • Carry additional information (data or metadata).

  • Provide additional behaviors.

  • Provide additional levels of indirection.

Some fairly obvious examples of value object types include
  • Money: Carries information about monetary ...

Get Design Patterns in .NET 6: Reusable Approaches in C# and F# for Object-Oriented Software Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.