Currently we put domain objects/entities into our ASP.NET sessions.
Now we considering moving from InProc sessions to state server. This requires that all objects inside session are serializable. Instead to annotate all objects with the [Serializable] attribute, we thought about creating custom-session objects (DTO Session Objects?), which only contain the information we need:
CONS:
- Entities must be reloaded, which requires additional DB round-trips
PROS:
- Session State is smaller
- Session information is more specific (could be a CON)
- No unneeded annotation of Domain-Entities
What do you think? Should we use some kind of DTOs to store inside the session, or should we stick with good old entities?