D
D
Dmitry2014-01-09 12:29:02
PHP
Dmitry, 2014-01-09 12:29:02

Which design pattern should be used to implement the class?

During script execution, a class must have only one entity. Which design pattern should be used to implement such a class?
Is the answer " Singleton " correct?
Maybe I just didn't understand the question.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
aen, 2014-01-09
@another_dream

Based
singleton would be the correct answer.

S
Sergey, 2014-01-09
Protko @Fesor

singleton evil. Where did the need to have only one instance of a class come from?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question