As Lead Architect of Joomla 1.5, Johan Janssens did a great job of creating a new framework to replace the "black box" that was Joomla 1.0. Joomla 1.5 is thriving, and developers are slowly discovering the full power of the framework. But the job isn't done. Below the Nooku multi-lingual extension, Johan and Mathias Verraes (of DOCman fame) created a new framework, that takes Joomla extension development to new heights.
2. Nooku Framework
The extension API that speaks for itself !
Joomladay NL, June 2009 - Nieuwegein
3. Technology, features, experience !
At some point, to stay viable, content management systems
require a quantum evolution that takes them beyond
technology and features and on to the satisfaction of a
customer experience. That’s what we are trying to do with
Nooku.
Johan Janssens
http:///www.nooku.org 1
2
7. What is it ?
Rapid extension development framework for Joomla.
•Version 0.7.0
• GPL v 2.0 license
• Non-commercial
• Joomla 1.5 only
• Installs as a plugin
• 30k lines of code
• Can work standalone
http:///www.nooku.org 1
6
8. Why a new framework ?
1. Developing for Joomla 1.5 :
• takes too much time
• too much repeated tasks
• resulting extensions are inflexible
• PHP4
2. Existing framework don’t integrate easily with Joomla
http:///www.nooku.org 1
7
9. How it used to be ...
...
class WeblinksController extends JController
// Checkout the weblink
{ $model = $this->getModel('weblink');
function __construct($config = array()) $model->checkout();
{ } break;
parent::__construct($config); case 'edit' :
{
// Register Extra tasks JRequest::setVar( 'hidemainmenu', 1 );
$this->registerTask( 'add', 'display' ); JRequest::setVar( 'layout', 'form' );
$this->registerTask( 'edit', 'display' ); JRequest::setVar( 'view' , 'weblink');
JRequest::setVar( 'edit', true );
}
// Checkout the weblink
function display( ) $model = $this->getModel('weblink');
{ $model->checkout();
switch($this->getTask()) } break;
{ }
case 'add' :
{
JRequest::setVar( 'hidemainmenu', 1 );
JRequest::setVar( 'layout', 'form' );
JRequest::setVar( 'view' , 'weblink');
JRequest::setVar( 'edit', false );
...
http:///www.nooku.org 1
8
10. How it should be ...
class WeblinksControllerWeblinks extends KControllerForm
{
//do nothing
}
class WeblinksModelWeblinks extends KModelTable
{
//do nothing
}
class WeblinksViewWeblinks extends KViewHtml
{
//do nothing
}
That’s all you need for a working MVC extensions !
http:///www.nooku.org 1
9
11. House Rules !
• Use existing Design Pattern
Don’t reinvent the wheel - just make it roll smoother
• Make all code reusable
Don’t repeat yourself - and don’t repeat anyone else either
• Extreme flexibility
Every object, and every part of the code must be extensible and replaceable.
Ability to hook into any controller, database or application action
• An API is like a User Interface
Learn once, apply everywhere
KISS : keep it sexy and simple
• Convention over configuration
• Scaffolding is a fancy word for copy/paste
http:///www.nooku.org 1
10
12. Features !
Flexibility Extensibility
•Auto-loading • Chain of command
• Factory/Object Store • Inflector
• Dependency injection • Mixins
• Smart and dynamic MVC • Decorators
Data handling Security
• ORM/Table Gateway • Auto CSRF protection
• REST/XML/JSON • Input filtering
http:///www.nooku.org 1
11
13. MVC
KModel
State State
Query Change
View Selection
KView KController
http:///www.nooku.org 1
12
14. MVC
KModel
State State
Query Change
View Selection
KView KController
Execute
Controller
KDispatcher
http:///www.nooku.org 1
13
15. KDatabase KTable
MVC
KModel
State State
Query Change
View Selection
KView KController
Execute
Controller
KDispatcher
http:///www.nooku.org 1
14
16. KDatabase KTable MVC
KModel
State State
Query Change
View Selection
KView KController
Execute
Controller
KDispatcher
http:///www.nooku.org 1
15
17. KDatabase KTable
MVC
KModel
State State
Query Change
View Selection
KView KController
Execute
Controller
KTemplate KDispatcher
http:///www.nooku.org 1
16
22. Who is using it ?
Anahita Social Engine
http://www.anahitapolis.com
Nooku Content
http://www.nooku.org
Custom Projects Upcoming Extensions
•Port of Antwerp •Virtuemart 2.0
• Italian Institute of Technology • YOOTheme
• Kainga Real Estate system • AEC Subscription
http:///www.nooku.org 1
21
23. Learn more ?
1. Check out our presentations
http://www.nooku.org/framework
2. Look at the API
http://api.nooku.org
3. Get code & mailing list access
http://www.nooku.org/framework/request.html
4. Come to a Nooku Code Jam
The next one is in Hamburg on June 27th
... or organize a Nooku Code Jam in your city
http:///www.nooku.org 1
22
24. You can find us at
http://www.nooku.org
You can follow us on
http://www.twitter.com/nooku
http:///www.nooku.org 1
23