Repository navigation
Conversation
Signed-off-by: bidi47 <bidi@apidemia.com>
|
@alexmerlin can you check this one ? |
There was a problem hiding this comment.
Comparing attributes with factories is like saying "car engines vs bikes", because just like car engines are a key part of cars, attributes are a key part of dependency injection.
What we want to compare is probably "dependency injection vs factories".
By changing this, probably the whole article will change fundamentally.
So, I will continue my review when the updated version has landed.
There was a problem hiding this comment.
but aren't attributes and factories implementation styles for dependency injection? so the comparison becomes #[Inject] vs. hand-written factories. i'll add this to the next update, along with some fixes for inconsistencies, and then request another review
There was a problem hiding this comment.
No, both are design patterns.
Just a quick search on comparisons between the two:
- https://www.reddit.com/r/javahelp/comments/15mcudc/is_dependency_injection_and_factory_pattern_the/
- https://medium.com/@nehamishra_77/factory-design-pattern-vs-dependency-injection-di-e0f8b993e66a
- https://www.geeksforgeeks.org/system-design/dependency-injection-vs-factory-pattern/
But, you can find tons of articles on the internet.
Attributes (#[Inject]) are just tools, methods (read as solutions) to implement the DI design pattern.
Just as annotations (@Inject()), which are another (older) tool used to implement the same concept.
That's why I insist on using the right term here - if I don't, our readers will.
And, since we're in the best practices category, we must make sure that we do a proper comparison, starting with the right terms.
There was a problem hiding this comment.
i see your point of view. the article is rewritten.
i'll have to replace the opengraph after your review.
Signed-off-by: bidi47 <bidi@apidemia.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #259 +/- ##
==========================================
Coverage 68.17% 68.17%
Complexity 597 597
==========================================
Files 95 95
Lines 2300 2300
==========================================
Hits 1568 1568
Misses 732 732 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: bidi47 <bidi@apidemia.com>
No description provided.