$Zend_auth->authenticate($adapter);
Why is it called an adapter and not a strategy?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Good question koen. I’d agree that the Zend_Auth_Adapter component is a good representation of the Strategy pattern. An argument could be made that it is a candidate for the Adapter pattern as well. It is serving as an adapter to whatever authentication mechanism you are using, which could be another class (making this more obviously an Adapter), but even for something such as authentication using credentials stored in a database it is serving as a plain-english adapter to your underlying credential store.
Also, there is no convention in the Zend Framework to call each class by it’s pattern name. There are no Xxx_Singleton, Xxx_Strategy, or Xxx_Builder classes despite there being classes that fit these patterns. Yet, at the same time there are Xxx_Decorator classes.
Most importantly, from it’s earliest days as a proposal it was referred to as an Adapter. The ZF community accepted this, and noone objected to it’s naming. Thus, it was adopted into the framework and will likely forever be known as Zend_Auth_Adapter.