This question can be vague, so i narrow down and list down some points i want to know.

  1. What are the design patterns used in Joomla (Just a list of them).
  2. In Which section of Joomla architecture those design patterns are used. (Indication only).

Some of the design pattern i noticed that are used in Joomla are singleton, factory and observer. I know there are some other too, so i want to know them. Any help will be appreciated

1 Answer 1


That's an interesting question, I hope this thread get some traction; as it is one I've asked periodically throughout my years working with Joomla. It's also a topic I feel which can provide insights to all levels of programmers.

When I asked a far more experienced programmer the same question, he said Joomla has lots of examples of hybrid and loose implementation with a few pure examples.

Now for my two sense!

MVC Architectural Pattern - probably most popular paradigm for structuring an application and its files for software development currently.

Command Pattern - The JHtml::_ and JText::_ classes resemble this pattern, although I'm not well versed on its official class diagram and would appreciate any insights.

Registry Pattern & Abstract Factory Pattern - An example of a hybrid approach I mentioned earlier in my opinion, in that the intent mimics the patterns but execution doesn't follow UML to the letter. JFactory would be the class which I'm referencing.

Strategy Pattern - A good example of this would be how JDatabase abstract factory handles implementation of database drivers through separation of concerns.

Now that you have peeked my interest on this topic again I will try and do some more research and hope other more knowledgeable developers can provide insights, corrections or clarity!

  • 1
    It's worth to say about Singleton too. For example JFactory::getDbo() is based on instance.
    – turson
    Commented Feb 5, 2015 at 7:24
  • yes, and what about observer pattern in plugin environment. Commented Feb 6, 2015 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.