The fact that there was two parts to the resulting documentation seemed a little obfuscated and so I thought that I should add a comment to help explain things. Normally this would be done this way:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhimce58aJ6TDgY-1V53_caX28Kd6aD4jCXxkq8eNROAtxaG62UmeiRnpZP0vROUB06IraW9PMoJipwfjb6IwVneDx9aaluWu9dnCsgpxeJ3V64Vp23-kMm_m4uqrvRF6_fbxUt5lYvv1PR/s640/WithComment.png)
However, by refactoring the service specific documentation to a separate method I was able to achieve my goal of documenting what the code was doing with the method name rather than injecting a coupled comment. This also has the benefit of making the code much more readable as well as self documenting.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCsOx5fOcfvh8cfHjDJRY6OfBzWtiMBEzRPP6yCMNBbnXrwKFH7Ll4Ib_SBXZBPn1PMWkpvS3BOiN9VYixPeC-wH8lTyOUQ7k2wuwjsWI8XrKMyRaAEEdfojQr7LayQDMI3pKHqzpem6rY/s640/Refactored.png)
No comments:
Post a Comment