Hi everybody, i just published this article about ...
# feed
g
Hi everybody, i just published this article about the Command Design Pattern (in Kotlin, of course) Tell me what you think about, pls https://medium.com/@acciarogennaro/the-command-design-pattern-in-kotlin-445ead6ca1f2?sk=5e754841dab19533ccd7c0cb47d776e4
👏 3
r
I like your article since it resembles the command as in GOF and others but this pattern seems to me unnecessary in languages like Kotlin where functions and polymorphism is first class. Can't command be described with just a function?
g
Yes, it is possible to perform the action from a function, but there is the coupling problem between who calls the action and who performs it. Using the Command Pattern, who calls the action doesn’t know who execute it, so if the “executer” changes he never know that 😄