Zend
200-530 · Question #243
You are creating an application that generates invoices in a variety of formats, including PDF, ODS and HTML. Each of these formats is represented as a PHP class in your application. While some of…
The correct answer is B. Factory. See the full explanation below for the reasoning.
Question
You are creating an application that generates invoices in a variety of formats, including PDF, ODS and HTML. Each of these formats is represented as a PHP class in your application. While some of the operations can be performed on all of the different formats (such as saving and loading), other operations may be specific to one or two of the formats (such as setting as read only). Which design pattern should you use for this application?
Options
- AAdapter
- BFactory
- CMVC
- DSingleton
How the community answered
(28 responses)- A4% (1)
- B82% (23)
- C4% (1)
- D11% (3)
Community Discussion
No community discussion yet for this question.