Browse Source

Added some comments about immutability Commands

pull/68/head
Cesar De la Torre 8 years ago
parent
commit
a07bb18dca
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs

+ 9
- 0
src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs View File

@ -5,6 +5,15 @@ using System.Runtime.Serialization;
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
{
// DDD and CQRS patterns comment: Note that it is recommened to implement immutable Commands
// In this case, its immutability is achieved by having all the setters as private
// plus only being able to update the data just once, when creating the object through its constructor.
// References on Immutable Commands:
// http://cqrs.nu/Faq
// https://docs.spine3.org/motivation/immutability.html
// http://blog.gauffin.org/2012/06/griffin-container-introducing-command-support/
// https://msdn.microsoft.com/en-us/library/bb383979.aspx
[DataContract]
public class CreateOrderCommand
:IAsyncRequest<bool>


Loading…
Cancel
Save