-
Notifications
You must be signed in to change notification settings - Fork 56
Added a word of Adapter pattern and Liskov #127
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
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
Clients & Adapters | ||
================== | ||
|
||
There are clients implementing one of the HTTPlug interfaces directly, | ||
and adapter packages that implement the interface and forward the calls to HTTP clients not implementing the interface. | ||
There are two types of libraries you can use to send HTTP messages; clients and adapters. A client implements the | ||
``HttpClient`` and/or the ``HttpAsyncClient`` interfaces directly. A client adapter is a class implementing the | ||
interface and forward the calls to a HTTP client not implementing the interface. (See `Adapter pattern`_ on Uncyclopedia). | ||
|
||
.. _`php-http/client-implementation`: https://packagist.org/providers/php-http/client-implementation | ||
.. _`php-http/async-client-implementation`: https://packagist.org/providers/php-http/async-client-implementation: | ||
.. note:: | ||
|
||
All clients and adapters comply with `Liskov substitution principle`_ which means that you can easily change one | ||
for another without any side effects. | ||
|
||
.. _`Adapter pattern`: https://en.wikipedia.org/wiki/Adapter_pattern | ||
.. _`Liskov substitution principle`: https://en.wikipedia.org/wiki/Liskov_substitution_principle | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't all links be at the bottom of the file? at least thats how its done in symfony docs. i would find it less confusing if they are all at the bottom. only one place to look for link targets... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
EDIT: I thought is was an inline link |
||
|
||
|
||
Clients: | ||
|
@@ -29,9 +35,11 @@ Composer Virtual Packages | |
------------------------- | ||
|
||
Virtual packages are a way to specify the dependency on an implementation of an interface-only repository | ||
without forcing a specific implementation. For HTTPlug, the virtual package is called ``php-http/client-implementation``. | ||
without forcing a specific implementation. For HTTPlug, the virtual packages are called `php-http/client-implementation`_ | ||
and `php-http/async-client-implementation`_. | ||
|
||
There is no project registered with that name. However, all client implementations including client adapters for | ||
There is no library registered with those names. However, all client implementations (including client adapters) for | ||
HTTPlug use the ``provide`` section to tell composer that they do provide the client-implementation. | ||
|
||
|
||
.. _`php-http/client-implementation`: https://packagist.org/providers/php-http/client-implementation | ||
.. _`php-http/async-client-implementation`: https://packagist.org/providers/php-http/async-client-implementation: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,5 @@ toolbar | |
username | ||
whitelist | ||
wiki | ||
Uncyclopedia | ||
workflow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/forward/forwarding/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/a HTTP/an HTTP/ (english grammar is about how its pronounced. H sounds like ahsh or something, so the a needs the n to link.