Welcome to this week’s post about refactoring.
The purpose was to take some classes and lines of code and make them look nicer and more maintainable. Also, we brought every method into the object class where it belongs. It was kind of fun doing these exercises. But we were not sure if we could adopt those measures to our real code of the project as we already tried implementing those rules beforehand. We will see that in the upcoming weeks.
We can give you a short idea of what we were supposed to do and how it came out.
Fowler
We talked about what example we should choose and how we wanted to proceed with it. First, we wanted to create a single repository where everyone could work for themselves but we noticed that this would not meet the requirements as we could not run the project due to namespace issues.
So instead, everyone created their own repository. This also had the positive side effect that no one could easily spy on others’ solutions.
We chose the example which was given in Fowler’s text instead of other possible projects from DBWorks as we were not sure how to start with this side project.
We worked on it independently but we were ready to compare results afterwards so we could improve our code.
Here are the links to our repositories:
Caution: Some links may not work yet because the code was not pushed yet. They will be accessible as soon as the publisher has finished the code.
That’s it from us today. Hope you enjoyed reading. We know, our posts are some kind of TLDR the past weeks, but we like writing down our thoughts in a creative way and hope for constructive feedback. If you have any comments please let us know below.
Cheers, stay healthy and have a good one,
RawBean
2 replies on “Refactoring”
Hey Robin,
don’t worry about your blog posts being a TL;DR – I don’t mind at all and even view it as a refresher.
I took a look at your different Fowler git repositories and you seem to be stuck at different stages at the process (which is perfectly fine). I also enjoyed this exercise, one thing I do want to point out however is that you shouldn’t push any artifacts of your development environment to git (e.g. Gino with his .idea folder).
Other than that nice work – I am looking forward to the next post!
Best regards,
Jonas (unitasks)
Hey Jonas,
thanks for your kind words. We like to be creative for our posts and code but we also got feedback that it may be too long and that some people won’t read too much text concerning the project.
We are actually revising parts of our refactoring code again and actually added .gitignore in that way so for the next commits there shouldn’t be any .idea folders left.
Thanks for the advice.
Keep it up and stay healthy,
-RawBean