Skip to content

Dependancy inversion module initial write up#4

Open
Surohitt wants to merge 9 commits into
masterfrom
suro_DIP
Open

Dependancy inversion module initial write up#4
Surohitt wants to merge 9 commits into
masterfrom
suro_DIP

Conversation

@Surohitt

@Surohitt Surohitt commented Jul 16, 2020

Copy link
Copy Markdown

I wrote up a little bit on the Dependancy Inversion Principle and how Mixins aid with the guidelines. Let me know your thoughts and if you think I got something wrong/missed something or would like to add in some notes!

@Surohitt please ignore this comment below I'm testing that we can link issues across the organization instead of just within the repo
Fixes: https://github.com/networks-for-change/product_scorecard/issues/1

@ArielleMurad ArielleMurad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Surohitt great job on this and thank you for taking the time to write this up! All of the explanations are very clear and to the point and your example with the animals is perfect for highlighting why Mixins and DIP are so important. I will definitely think about this design principle when writing code in the future!

Comment thread README.md
Comment on lines +908 to +909
By dictating that both high-level and low-level objects must depend on the same abstraction, this design principle inverts the way some people may think about object-oriented programming.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to have another example to illustrate this point. Your example below for Mixins already does a good job of this though so up to you! I personally learn most from reading through examples with code and seeing how these theories and principles can be implemented so in my opinion, the more examples the better 😉

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point! I might add a visual for this :)

@Lee-Sutton Lee-Sutton left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Surohitt awesome work on this! Great use of examples in the mixins section! I only have one comment and a couple suggestions for typos but nothing major.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
Mixins are a special type of multiple inheritance. There are two typical situations that
require mixins:
1. You want to add in a lot of features and/or methods for a class
2. You want to use a particular feature and/or across many different classes

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an important point to note is that a mixin should not hold internal state. It should only add functionality via methods or properties

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point, I might add a tiny section or list of points titled, what is a mixin?.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe, what is not a mixin?

Surohitt and others added 7 commits July 16, 2020 16:35
Co-authored-by: Lee Sutton <[email protected]>
Co-authored-by: Lee Sutton <[email protected]>
Co-authored-by: Lee Sutton <[email protected]>
Co-authored-by: Lee Sutton <[email protected]>
Co-authored-by: Lee Sutton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants