Skip to content

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

Merged
merged 5 commits into from
Aug 2, 2016
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions clients.rst
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).
Copy link
Contributor

Choose a reason for hiding this comment

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

s/forward/forwarding/

Copy link
Contributor

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.


.. _`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
Copy link
Contributor

Choose a reason for hiding this comment

The 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...

Copy link
Member Author

@Nyholm Nyholm Aug 2, 2016

Choose a reason for hiding this comment

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

I usually have likes that I use more than once at the bottom. But I'll change and make sure I put all links in the bottom in the future.

EDIT: I thought is was an inline link



Clients:
Expand All @@ -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:
1 change: 1 addition & 0 deletions spelling_word_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ toolbar
username
whitelist
wiki
Uncyclopedia
workflow