nerdexam
Zend

200-530 · Question #141

You are creating an application that repeatedly connects to a database to retrieve order data for invoices. All data comes from the same database. In order to preserve resources, you have to ensure…

The correct answer is D. Singleton. See the full explanation below for the reasoning.

Question

You are creating an application that repeatedly connects to a database to retrieve order data for invoices. All data comes from the same database. In order to preserve resources, you have to ensure that only one database connection should be used at any time. The code also has to open as few new database connections as possible. Which design pattern should you use for this scenario?

Options

  • AAdapter
  • BFactory
  • CMVC
  • DSingleton

How the community answered

(50 responses)
  • A
    16% (8)
  • B
    4% (2)
  • C
    8% (4)
  • D
    72% (36)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice