Actions
Bug #28980
closedt3lib_http_Request must not extend PEAR HTTP_Request2, but should encapsulate it instead
Start date:
2011-08-15
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
4.6
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:
Description
Currently t3lib_http_Request extends PEAR's HTTP_Request2 class. By doing so all methods of HTTP_Request2 are exposed as public API. If at some point, for what ever reason we decide HTTP_Request2 to replace it, this will be a problem as we would have to replace the whole HTTP_Request2 public API like it is.
To avoid this and make replacing of the 3rd party library easier we should encapsulate HTTP_Request2 instead of extending it. We then only expose the methods we really need.
Summarizing reasons to encapsulate instead of extending:- we may not want or need all the methods a 3rd party lib offers
- when updating the 3rd party lib, methods may be added or removed without us noticing, again including unwanted changes or methods
- naming of methods may not fit our naming conventions
- abstraction and decoupling to make replacement easier
- easier unit tests as only exposed APIs need testing
- lib is not actively developed anymore
- other libraries are performing better
- other libraries provide better APIs
- other libraries provide better features
- other libraries have fewer bugs
Actions