Spiral Hero
I cannot understand the command pattern.
"you can store those commands to a database to deal with them later" you mean like make a list of those command objects (createuserprofilethumbnail)? can't you store it using the client object?
like, whenever it calls for a method of the receiver, it stores on a list an enum that represents that command and then later you can use that to anything you want (i legit just thought of this in 5 minutes so its probably not optimal at all but i hope you get the point that im struggling to see the benefits)
15 replies
Dependency Injection question
Ok so, the issue with coupling is that you cant use ClassA (in this case, SomeService) without running the exact implementation of ClassB
While with DI (in this example via an Interface) you could try out other ClassB implementation for testing purposes
75 replies