Slide 22
Slide 22 text
Named Model Types
When should we use struct vs. class?
“In all other cases, define a class, and create
instances of that class to be managed and
passed by reference. In practice, this means
that most custom data constructs should be
classes, not structures.”
Use a struct when:
- Encapsulate few, simple data values
- Data can be copied (passed by value)
- Does not need inheritance