• Save
Jab12 - Joomla! architecture revealed
Upcoming SlideShare
Loading in...5

Jab12 - Joomla! architecture revealed



J and Beyond 2012 - Joomla! architecture revealed by Ofer Cohen

J and Beyond 2012 - Joomla! architecture revealed by Ofer Cohen



Total Views
Views on SlideShare
Embed Views



4 Embeds 54

http://jandbeyond.org 51
http://translate.googleusercontent.com 1
http://www.docseek.net 1
http://www.docshut.com 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Jab12 - Joomla! architecture revealed Jab12 - Joomla! architecture revealed Presentation Transcript

    • Joomla Architecture Revealed! Ofer Cohen @oc666 ongage.com jomland.com
    • 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) 
    • 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.
    • Joomla!● 2.8% of all websites, worldwide● Object Oriented● Components based on MVC design pattern● What else?
    • 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...
    • Revealed?● Who cares? It Just Works! (TM)
    • Revealed!● Why is my Joomla! site slow? hacked?..● Want to build a complicated website?● What are the abilities of Joomla?● What cant I do with Joomla?● I just love to research and learn!
    • 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.
    • Tricks?The tricks are design patterns - reusablesolutions to commonly occurring problemswithin a given context in software design.(wikipedia)
    • Step back.... J! index.php1. constants and defines declared2. configuration loaded3. application init triggered (lang, editor)4. routing parsed the request (url, arguments)5. dispatch the component6. render the template7. echo the response output
    • Looks simple, but whats 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.
    • 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.
    • VMC... MCV... WTF? Prefer BMW?● MVC - Model-View-ControllerDivide the software into 3 layers: ○ M=>Logic ○ V=>User interface ○ C=>Request handler
    • MVC - advantages● Easier to extend.● Less spaghetti code.● Great approach on upgrades and new features.● Easier collaboration between multiple developers.
    • 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.
    • Factory● Supplier of the main entities of Joomla: ○ Session ○ User ○ Cache ○ Database...● Each entity is singleton
    • Singleton● Only one instance of an object is kept.● Saves system memory usage & cpu
    • Bridge● Decouple an abstraction from its implementation.● Useful for implementation encapsulation.● Especially when the program decides how to implement on run time.
    • 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.
    • Bridge - code example from J!DBabstract class JDatabase { public static function getInstance($options) { $class = JDatabase . ucfirst($options[driver]); $instance = new $class($options); self::$instances[$signature] = $instance; return self::$instances[$signature]; }}
    • 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.
    • 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).
    • 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)