}
Is it still worth creating an entire command DTO here? Why not just pass the GUID directly?
Actually, it doesn’t matter how many parameters there are:
- The intent of the command (in this case, cancelling a restaurant booking) is more important than the data it carries.
- Having a named command object makes this intent explicit. Not possible just with a GUID argument on your operation contract.
- Adding another parameter to the command (say, for example, an optional reason for cancelling) would require you to change the signature of the service contract. Ading another property to a command object would not.
- Command objects are much easier to pass around than a bunch of random variables (as we will see in the next post). For example, you can queue commands on a message bus to be processed later, or dispatch them out to a cluster of machines.
Why not just one overloaded Execute() method?
Instead of having one operation contract per command, why don’t you just use a single overloaded method like this?
[ServiceContract]
eset endpoint security 5 username and password endpoint security 2014 gartner