A
A
Alexey Nikolaev2015-11-22 16:02:26
PHP
Alexey Nikolaev, 2015-11-22 16:02:26

How would you rate a structure like this (Singleton + MVC)?

Good day!
I tried to combine two patterns - MVC and Singleton, to combine the advantages of both in one. Here 's what happened .

spoiler

Each subclass of a singleton refers to a single instance of itself, which is stored in a private variable of the main class (singleton). This allows all subclasses to be used without having to instantiate them.

A question for experienced developers - how would you rate such amateur performance? And how would you implement MVC with one entry point?
Thank you for your attention.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2015-11-22
@Heian

https://en.wikipedia.org/wiki/Service_locator_pattern
You have reinvented the Service Locator antipattern.

S
Stanislav, 2015-11-22
@mzcoding

Not the best implementation though)) It's better to look at how routing works in Symfony / Laravel, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question