http://stackoverflow.com/questions/521298/when-to-use-struct
Struct
Struct is a blueprint for a value – no identity, no accessible state, no added behavior (methods).
Variables of struct type are strictly called values.
Value types are the types found at the lowest level of a program. They are the elements used to build larger software entities. Value types can be freely copied and exist on the stack as local variables or as attributes inside the objects they describe.
Consider defining a structure instead of a class if instances of the type are small and commonly short-lived or are commonly embedded in other objects.
Do not define a structure unless the type has all of the following characteristics:
It logically represents a single value, similar to primitive types (integer, double, and so on).
It has an instance size smaller than 16 bytes.
It is immutable.
It will not have to be boxed frequently.
notes –
In addition, realize that when a struct implements an interface – as Enumerator does – and is cast to that implemented type, the struct becomes a reference type and is moved to the heap.
Whenever you don’t need polymorphism, want value semantics, and want to avoid heap allocation and the associated garbage collection overhead. The caveat, however, is that structs (arbitrarily large) are more expensive to pass around than class references (usually one machine word), so classes could end up being faster in practice.
Class
A class is a blueprint for an object.
It has identity. Identity is an instantiated object with its own state.
It has accessible state (private variables), added behavior (methods).
Types represented by classes are called reference types.
Reference types are the types found at the higher levels of a program. They are built from smaller software entities. Reference types generally cannot be copied, and they exist on the heap.
If you copy a struct, C# creates a new copy of the object and assigns the copy of the object to a separate struct instance. Thus, we’re dealing with the object itself.
However, if you copy a class, C# creates a new copy of the reference to the object and assigns the copy of the reference to the separate class instance. We’re dealing with the address here.