Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Adaptation docs to be more concrete. #233

Merged
merged 2 commits into from Mar 17, 2021
Merged

Conversation

jamadden
Copy link
Member

This should help provide better motivating use cases compared to the what the docs called the "silly" example of converting one number to another.

Examples inspired by https://glyph.twistedmatrix.com/2021/03/interfaces-and-protocols.html

Also some minor typo fixes and updates to comments. (One of which is for zopefoundation/zope.component#53.)

This should help provide better motivating use cases. Examples inspired by https://glyph.twistedmatrix.com/2021/03/interfaces-and-protocols.html

Also some minor typo fixes and updates to comments.
@jensens
Copy link
Member

jensens commented Mar 17, 2021

I often explain adaption with the abstract factory design pattern. At least for those who learned about design patterns this simplifies understanding a lot.

@jamadden
Copy link
Member Author

Agreed, that can be a good way to explain it.

I'm not sure that's the appropriate approach for this particular piece documentation though, because it's, well, abstract 😄

The original was trying to work through some concrete examples, with the intent of showing how things work and how you can use them. But upon re-reading it as a result of asking glyph to link to it, I found that the "concrete" examples, well, weren't (converting 0 into 42? Why would I want to do that?). I wanted to improve that and make the material more engaging so that hopefully people can more easily imagine how they might use it in their projects. Using points was the first example that came to mind (and it seemed pretty good because there are many representations for the same thing, but they all work slightly differently), but if there's a better one I'd be happy to make adjustments.

Copy link
Member

@icemac icemac left a comment

Choose a reason for hiding this comment

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

LGTM.

docs/README.rst Outdated Show resolved Hide resolved
Co-authored-by: Michael Howitz <mh@gocept.com>
@jamadden jamadden merged commit 7a9fcdd into master Mar 17, 2021
@jamadden jamadden deleted the docs-update branch March 17, 2021 16:43
@jamadden
Copy link
Member Author

Thank you for the reviews and comments.

@jensens
Copy link
Member

jensens commented Mar 17, 2021

Do not get me wrong, your example makes it way easier to understand. Thanks! It was just an idea....

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.

None yet

3 participants