Discover and read the best of Twitter Threads about #dependencyinjection

Most recents (2)

Knowing the problems is the first step to solving them.

A thread on #CodeSmells 🧵⬇️📅
#CodeSmell 01: Your objects are a bunch of public attributes

Problem: en.wikipedia.org/wiki/Anemic_do…

Solutions:
1) Find Responsibilities.
2) Protect your attributes.
3) Hide implementations
4) Delegate
#CodeSmell 02: Code has lots of comments

Problem: Comments are coupled to implementation

Solutions:
1) Refactor methods
2) Rename methods to more declarative unes
3) break methods
4) If a comment describe what a method does. Just name the method with this description
Read 49 tweets
to get to the clearest design, it's ok always be shifting things (methods, values, entities, aggregates) to where they make the most sense in the model; reflect on ISP, cohesion, coupling, on adding/removing layers, on simplicity, on asking more questions
spoken like a true refactor addict
where would be the best home for a piece of logic?

a) in the object that knows the business rules
b) in the object that has the data
Read 4 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!