2. About me, Joomla and Arch
● Open source volunteer since 2006.
● Joomla volunteer since 2007.
● CMS & Platform Code contributor
● JBS team member
● GSoC mentor of Joomla
● Extensions Developer (check TP2 at
Jomland)
3. Not enough?
● Joomla Hebrew translation coordinator
● Joomla Israeli community leader
● Joomla!Day Israel organiser
● OSM board member
● Daily job: R&D manager in the Start-Up
nation.
4. Joomla!
● 2.8% of all websites, worldwide
● Object Oriented
● Components based on MVC design
pattern
● What else?
5. Architecture?
● Architecture
the process and product of planning, designing
and construction...
● Software architecture
depiction of the system that aids in the
understanding of how the system will behave
● Website architecture
approach to the design and planning of
websites...
7. Revealed!
● Why is my Joomla! site slow? hacked?..
● Want to build a complicated website?
● What are the abilities of Joomla?
● What can't I do with Joomla?
● I just love to research and learn!
8. Object Oriented
● Data structures consisting of data fields and methods
together with their interactions
● Programming techniques include features such as data
abstraction, encapsulation, messaging, modularity,
polymorphism, and inheritance.
● This approach make your program more easy to build
and implement tricks.
9. Tricks?
The tricks are design patterns - reusable
solutions to commonly occurring problems
within a given context in software design.
(wikipedia)
10. Step back.... J! index.php
1. constants and defines declared
2. configuration loaded
3. application init triggered (lang, editor)
4. routing parsed the request (url, arguments)
5. dispatch the component
6. render the template
7. echo the response output
11. Looks simple, but what's inside?
1. Component is first dispatched and then
buffered.
2. Template render with their modules and
then set output into response (object).
3. Events trigger between each step.
12. Template Walk...
--> How is a template rendered?
1. The index.php of the template is rendered.
2. Parsing jdoc statements.
3. Each jdoc statement rendered separately,
iteratively, according to its type.
4. Component & head are parts of the
iteration, but have different rendering.
14. MVC - advantages
● Easier to extend.
● Less spaghetti code.
● Great approach on upgrades and new features.
● Easier collaboration between multiple
developers.
15. Plugin=Observer
● Events handling
● Simple dispatcher can be called
● It fires events to Joomla plugins on basic
triggers.
● For example, after content creation,
before user delete, etc.
16. Factory
● Supplier of the main entities of Joomla:
○ Session
○ User
○ Cache
○ Database
...
● Each entity is singleton
17. Singleton
● Only one instance of an object is kept.
● Saves system memory usage & cpu
18. Bridge
● Decouple an abstraction from its
implementation.
● Useful for implementation encapsulation.
● Especially when the program decides
how to implement on run time.
19. Bridge - example
● J!Database instance built by its
instantiator method input.
● The method will return its nested
inheritance object
● The object type would be unknown, only
the methods we can call would be
known.
20. Bridge - code example from J!DB
abstract class JDatabase {
public static function getInstance($options) {
$class = 'JDatabase' . ucfirst($options['driver']);
$instance = new $class($options);
self::$instances[$signature] = $instance;
return self::$instances[$signature];
}
}
21. Adapter
● Adapter translates one interface for a class
into a compatible interface.
● For example DB adapter for DB such as
MySQL, MSSQL, Postgre.
● Another example would be Renderer object
for rendering output of module,
component, header, etc.
22. Future
● HMVC - reuse of each part of the MVC
pattern.
● Traits - the long tail story
● UCM - want to select from articles
content and virtumart products at the
same query. ORM-Like methods (NOSQL).
23. Conclusion
● The only complicated thing is the
problem.
● The solution must be simple.
● If you have a complicated solution, you
probably chose the wrong solution (KISS)