Torkil Johnsen

My personal piece of cyberspace

What is this Nooku Framework thing really? And why should I care?

Posted in joomla on Jul 15th, 2010

Let me try to explain, in non-technical terms, what a framework is and why using the Nooku Framework is a good idea.

Preface

No, not “preface” as in “this is the start of a long and boring novel”. It’s just two quick preliminary pieces of information that you need to be aware of:

  1. Nooku Framework is not to be confused with Nooku Content. Nooku Content is more a competitor of Joom!Fish: It’s a Joomla component used for translating content. Nooku Content is also distributed only among paying partners in a partner programme. Nooku Framework however, is a programming framework, and it’s free and open source software (FOSS). Both products are backed by the same developers though, hence the similar names.
  2. When I say framework, I really mean software framework, a term which Wikipedia defines and explains really nicely. But don’t click that Wikipedia link for now. Instead, let me give you the short story, from a Joomla perspective:

What is a framework?

A framework allows you to reuse common programming code, which is a good thing. Let me explain why by comparing a framework to something a lot easier: Your e-mail signature. In your e-mail software, like Outlook or Apple Mail, you write your e-mail signature once in your settings, then automatically use it whenever you send an e-mail.

This means:

  • You spend less time writing your e-mail.
  • Time saved means you have more time to do what’s important: Focusing on the contents of your e-mail.
  • You get the signature right each time; In a stressful situation you might forget to include your phone number or even type your name incorrectly, but not when you’re using a predefined signature.

The same thing goes for software frameworks from a programmer’s perspective:

  • It saves you time by eliminating the need to do repetitive tasks, which means you can focus on what’s important: Finishing the application and making sure it meets the requirements.
  • You get less bugs in your system, because the parts handled by the framework have been used and tested earlier, and are usually bug free. So the more framework code you use, the less bugs you should experience. More time saved.
  • An added bonus: A framework with multiple users allows people to find bugs together, in their shared, common code.

So what’s the difference between Nooku, Joomla and the Gantry Frameworks?

I see many people asking this question, so I just had to answer it once and for all:

Nooku and Joomla try to accomplish the same thing: To make developing Joomla components, plugins and modules easier. This is primarily stuff happening under the hood you might say. Gantry is a framework made by Rockettheme to make developing templates easier, which is more the facade of your website.

In other words, you can’t compare Gantry to the other two. Instead you should compare Gantry to the Morph Framework, which is rumoured to be Nooku based in the future, but that’s a whole different story.

Why do I prefer Nooku Framework over Joomla’s own framework then?

I have been a part of the Mambo/Joomla community since 2004, and I have written components both using the Joomla Framework and the Nooku Framework. So I have tried and tested both, and have decided to use Nooku for the following reasons:

  • It’s better. For me as a programmer. It reduces the amount of code I need to write by something close to 80%1, which means more time for me to spend on creating new and cool stuff, and less bugs for you to get annoyed over. The only two programmers that I know of that have looked into Nooku and still decided they preferred the Joomla Framework, have been OSM employees. I.e. the guys who are paid to develop the Joomla Framework.
  • It makes me better. Nooku reuses solutions to common problems (called using design patterns) to a greater extent, and unlike Joomla it forces me to adhere to conventions and standards. No slacking around in other words. The predictability in the coding combined with strict data filtering gives my components easier extensibility and my clients better security. I’ve recently also started using HMVC, and I’m loving it.
  • It’s Joomla compatible. Any Joomla website that needs custom functionality can start using Nooku to build that functionality, today. It installs like any other extension, and does not interfere with what’s already on your Joomla site and using the Joomla Framework.
  • It’s cheaper. I know; too obvious. Less time spent programming + Less bugs = Lower development and maintenance costs.
  • It’s the second generation. Yes, literally the second generation. You may now know, but both the Joomla and Nooku Frameworks were built basically by the same guy: Johan Janssens. In fact, Johan is still considered to be the largest contributor to the Joomla codebase (by far!), even though he stopped working with Joomla in January 2008. He took with him the knowledge and lessons learned, and started from scratch to build something better: Nooku.
  • It’s got a developer community. Unlike Joomla, development at the framework level is moving forward at a rapid pace, there is lots of activity, and developers are sharing and contributing code between themselves. In the web development industry, things are moving forward very quickly, and for the sake of myself and my clients, I need to keep up and stay sharp.

So I choose Nooku.

If you’re a programmer yourself, go check it out at http://www.nooku.org/framework.html. If not, you should talk to whoever does the programming for you and make sure that they do.

Footnotes

  1. The 80% figure is borrowed from NinjaBoard’s comparison. This, though, dates back to October 2009, after which the Nooku Framework has improved further, so the number should probably be higher than 80%.
  • Pingback: Torkil Johnsen » New buzzword on the block: HMVC

  • Helio Alves

    Hi Torkil,

    Thank you very much for your post. I’ve been following Nooku framework for quite some time now. I subscribed for the Google group and can see that it is very well supported, everyone is always wiling to help.

    I’d like however your opining, a guy like me who only has basic knowledge of PHP and who wants to start learn developing Joomla components should I go for Nooku right a way or should I first start with Joomla framework first, see how it works with the MCV model and then once I master it jump into Nooku Framework?

    Thank you again.

  • Helio Alves

    Hi Torkil,

    Thank you very much for your post. I’ve been following Nooku framework for quite some time now. I subscribed for the Google group and can see that it is very well supported, everyone is always wiling to help.

    I’d like however your opining, a guy like me who only has basic knowledge of PHP and who wants to start learn developing Joomla components should I go for Nooku right a way or should I first start with Joomla framework first, see how it works with the MCV model and then once I master it jump into Nooku Framework?

    Thank you again.

  • http://joejoomla.com JoeJoomla

    This is one of the best explanations of the Nooku framework that I have read to date. You did a great job of making a framework understandable to the layperson in this article.

    I only have so much time in the day to read and research articles but your site just made my required reading list with this one!

  • http://joejoommla.com JoeJoomla

    This is one of the best explanations of the Nooku framework that I have read to date. You did a great job of making a framework understandable to the layperson in this article.

    I only have so much time in the day to read and research articles but your site just made my required reading list with this one!

  • http://www.torkiljohnsen.com tj

    @Helio: Joomla and Nooku are two frameworks that do the same stuff, only Nooku does it better. The fact that Joomla requires you to write more PHP will give you more training in writing PHP, obviously. It is however very lenient when it comes to standards and conventions, and will allow you to write a lot of “bad” MVC, whereas Nooku will do much of the basic MVC for you, but you will still have to get an understanding for how it works.

    I would do it properly the first time around, and learn Nooku. I’ve read quite a few pages of framework code and I’m still learning many of the concepts myself. Developer community is however great, as you have noticed, so it’s a nice place to be learning stuff.

  • http://www.torkiljohnsen.com tj

    @Helio: Joomla and Nooku are two frameworks that do the same stuff, only Nooku does it better. The fact that Joomla requires you to write more PHP will give you more training in writing PHP, obviously. It is however very lenient when it comes to standards and conventions, and will allow you to write a lot of “bad” MVC, whereas Nooku will do much of the basic MVC for you, but you will still have to get an understanding for how it works.

    I would do it properly the first time around, and learn Nooku. I’ve read quite a few pages of framework code and I’m still learning many of the concepts myself. Developer community is however great, as you have noticed, so it’s a nice place to be learning stuff.

  • http://www.torkiljohnsen.com tj

    @JoeJoomla: Thanks and thanks again :) I’ll try to keep it up.

  • http://www.torkiljohnsen.com tj

    @JoeJoomla: Thanks and thanks again :) I’ll try to keep it up.

  • Helio Alves

    Hi Torkil,

    Thank you very much for you reply :)

    I will definitely give a try to Nooku again. I need although to understand the concepts of MCV and. Who call what, and who’s supposed to do what. Do you have a good book or a good tutorial for the MCV model for Joomla?

    Thanks

  • Helio Alves

    Hi Torkil,

    Thank you very much for you reply :)

    I will definitely give a try to Nooku again. I need although to understand the concepts of MCV and. Who call what, and who’s supposed to do what. Do you have a good book or a good tutorial for the MCV model for Joomla?

    Thanks

  • http://torkiljohnsen.com Torkil Johnsen

    Sorry guys and gals, Disqus is refusing to import the comments from this site. Have to fiddle a bit more to get them back up.

  • http://torkiljohnsen.com Torkil Johnsen

    MVC is an architectural design pattern. Basically, the controller is responsible for handling and processing the request that the user makes. The model is responsible for getting and storing data, and the view is responsible for the visual parts of things.

    In a basic request in Nooku, the controller will receive a request, and set the model states, the view will fetch data from the model which will be filtered/ordered based on the state.

    That's the basic idea, and barely scratching the surface :) Reading the actual Nooku FW code should be a lot more informative, or you could ask on the mailing list.

    As far as reading material goes:

    Oleg Nesterov gave a really good presentation on MVC at J and Beyond 2010, in his presentation called “Joomla Extensions Kung Fu”. The Nooku Framework workshops first part contained much of the same information.

    Here are the slides from Oleg's presentation:
    http://www.alltogetherasawhole.org/profiles/blo

    The videos from the Oleg's and the Nooku presentations are not up yet. Keep an eye on tweets from Jeremy (@gnomeontherun) and check in on the videos list here: http://jandbeyond.org/video.html

    You could give a nudge to Johan and Jeremy and ask about those.

    Here is a somewhat older Nooku MVC presentation too:
    http://prezi.com/wu27cp80-byh/nooku-framework-mvc/

    Hope that gets you started :)

  • helioalves

    Thank you very very much Torkil :)
    I really appreciate the time you put to answer and the precious information you gave me.

    I will definitely take a look at what you gave me and will study the MVC model to get started with Nooku Framework.

    I understand why Nooku Framework is growing so fast, with people like you engaged on it, it's very easy for newbies, like me, to get started and get help.

    Once again, many thanks to your time :)

  • http://torkiljohnsen.com Torkil Johnsen

    We all started somewhere. With all the time that others put in to help me, I feel that I should do the same. When you get up to a certain level of knowledge, you'll do the same to other newbies, and so the story goes… ;)

  • http://torkiljohnsen.com Torkil Johnsen

    I recently wrote a blog post on HMVC. I think I'm going to rewrite that a bit to explain the concepts of MVC and HMVC a bit better and make it easier for people without knowledge about these patterns to understand.

  • http://torkiljohnsen.com Torkil Johnsen

    Helio, I put up a better explenation in a separate blog post :)

    http://www.torkiljohnsen.com/2010/07/15/mvc-exp

  • Helios25

    Thank you very much Torkil,

    I read your post about HMVC (which is not online anymore) and for me it was quite hard to understand all the concepts. When you talk about domain separation at first I though it would have anything about domain name but I then remembered that I read something about domain and if I'm not wrong domain in this case would be “controllers” but I'm not even sure :)

    I've been searching for good tutorials for newbies but quite hard to find one, I started with your article on installing Nooku Framework with the symlinker: http://blog.bedre.no/nooku/tutorials/installing
    and it seems to be linked properly, I then when through these two tutorials:
    http://www.alltogetherasawhole.org/profiles/blo
    http://www.alltogetherasawhole.org/profiles/blo
    With these two tutorials I get confused because I don't know where I should create my files.

    I guess I'll try to start with Joomla Framework and then switch over Nooku Framework.

    Thank you for your help and keep with the nice posts :)
    and Thank you for writing a new post explaining MVC for newbies :) very appreciated

  • http://torkiljohnsen.com Torkil Johnsen

    I took down my HMVC post as I realized it was too unfinished and other concepts needed explaining first before I could dive into HMVC. Next article will be about the object factories JFactory and KFactory. After that I might take a stab at HMVC too, and perhaps write it in a less complicated way than what I did earlier.

    As @christianhent recommended on Twitter, I suggest you look at the example component com_harbour, which you can find on http://nooku.assembla.com. It's a sort of advanced hello world component.

  • Pingback: Nooku Framework, why should you care ? « Nooku Blog

  • Pingback: Torkil Johnsen » Taking Joomla Forward

  • http://twitter.com/JPodium JPodium

    good article that finally makes me test Nooku for JPodium

  • http://torkiljohnsen.com Torkil Johnsen

    I don’t think you’ll be disappointed.


Creative Commons License
This work by Torkil Johnsen is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.