3 ms·
It took me quite a while to really understand the correct assignment of responsibilities to objects and how to refactor them when things got tangled. I would f
by mattgibson 9y ago
It took me quite a while to really understand the correct assignment of responsibilities to objects and how to refactor them when things got tangled.
I would follow framework conventions, but get lost when leaving them and end up with spaghetti. The code worked, but was hard to maintain and reason about. I've now learned a lot about core OO concepts e.g SOLID, and learned about the role of sequence diagrams in mapping out what each object's role is and it's a totally different experience.
I'd recommend Practical Object Oriented Design in Ruby by Sandi Metz for a great introduction to thinking clearly about objects. Not Ruby specific - that's just the code examples, really. http://www.poodr.com/ http://www.poodr.com/
- ows 9y agoGood example! I try and apply myself to split things in self-sufficient services but can't really say it observes strict OO conventions. Also, refactoring is a newly acquired taste, and I'm not even sure I do it right. Basically just try to untangle things as the project gets bigger / more complex. Will have a look at your link, thanks!