Oxwall: The Developer's View

Hi Everyone! My name is Sardar and I am one of the Oxwall Software core developers. In this blog I want to share with you lot’s of interesting things you may encounter learning our software. I'm glad to bring to eveyone’s notice all information I have. I may consider that this info will be valuable for plugin developers and potential soft contributors, i.e. most part of info covers soft technical aspects.
Sardar M.

So what is Oxwall? Oxwall is the absolutely free open source high performance plugin based social community software. And without a doubt, Oxwall is one of the most effective and advanced solutions in the social software niche. You should just try to get into the soft and I'm sure you'll fall in love with Oxwall.

For the last several years we can observe a great boom of social sites, and still the trend continues to grow. I barely know anyone who doesn't know giants such as Facebook and Google+; almost everybody who has an internet access nowadays is involved in social networking process.

Social giants offer great features for most part of people; however there is a large amount of them with special requirements such as an intensified privacy for their social group, some specific functionality, custom design, etc. And in order to match their needs and requirements they have to turn to social community softwares like Oxwall. Along with Oxwall, we can see a number of the similar softwares in the market (including CMS and blog softs with special plugins); all of them have various advantages and drawbacks. We did our best to create the soft which would include all the best from the market players and meet requirements of social community builders in the best way.

Created from scratch

Oxwall is absolutely custom software developed from the scratch. The first thing that comes to your mind will be - "Why? Why guys have you done such a stupid thing? You spent so much time for reinventing the wheel." Yes, in some way we reinvented the wheel, but it was done only to make the Oxwall better. Of course, today we live in the age of a significant "PHP web frameworks boom"; they deliver the ready platform for turning your ideas into the working project in a short time. Indeed there is a little reason to code the project from the scratch. But you shouldn't miss the disadvantages of ready frameworks - they have too heavy and complicated code, in order to fit specific requirements they need a lot of configuration and customization in most cases, some of them have serious issues with performance, etc.

We had great debates in our team trying to decide if we should have used some framework or should have developed the project from the scratch. It was a hard decision - we decided to develop it from the scratch using the best ideas from the popular frameworks. We took the decision basing on our previous experience in several web frameworks. We used several full featured ones developing on Java (Wicket) and PHP (Kohana) in our previous projects. They make development process really fast and easy: less time for projecting, coding and debugging. You have all the standard web application blocks out of the box, and it's really cool unless you need to break their rules. Sometimes you need to do very specific things in your application and it may invoke a real pain in high leveled frameworks. You have to change your requirements or use some dirty hacks and kludges to complete the task. It was very sad when we spent in vain several days on reading the documentation and support forum topics for sake of implementation of some small things.

Getting fundamentals

If you have used any well-known web framework before, you should feel yourself right at home with Oxwall. Like in any of them we stick the same concepts: keeping the code simple, clean and organized; avoiding the mix of database calls, business logic and templates. In other words we implemented MVC (Model, View, Controller) pattern using the best practices of popular web frameworks and softs. For your guidance there are so many approaches for implementing the MVC framework that sometimes it's not so easy to get into the code from the first sight. Don't worry; in Oxwall we tried to implement it in a simplest way. We sticked to the same approach in all other software aspects. To make it more understandable let me introduce to you the application lifecycle in general:

This is the simplified model, but it reflects the main idea of application lifecycle. Let us see the whole list:

  • Application initialization
    First step includes preparation of all application blocks for request handling (constants, autoloading, error handling, managers preparation).
  • Plugins initialization
    Running all active plugins initializers. Here all plugins register classes, routes, and events for request handling and interacting with other plugins.
  • Routing
    Router parses the request string to find the controller and action to handle the request.
  • Request handling
    Request handler creates the instance of needed controller and calls the action, passing parsed params into it. Controller's action makes all the magic for markup generation. It uses service and DAO (Data Access Object) objects to access the database and to run plugin business logic. Rendered markup is returned to application object.
  • Document compiling
    After getting controller markup the application compiles whole document body (master page, js and css includes, HTTP headers).
  • Sending response to browser
    When everything is ready application returns request result - compiled headers and markup. Than application triggers shutdown event and script finishes.

As you can see the whole process is simple enough. In any case, if you did not manage to understand something from above-described, don't worry - this scheme shows the whole process only in general. We'll look into every step from inside and in details later.

What's special about Oxwall

So what special about Oxwall? As I told before Oxwall incorporates many cool ideas from many great softs and frameworks. We have been developing it trying to stick to three main concepts:

  • Easiness
    At a glance, Oxwall seems little bit complicated, however you need to spend several hours to learn the basics and start developing your own plugins. We build our application on a very simple MVC model and on a set of special managers. So make sure you understand our MVC approach and play with several basic managers in the soft.
  • Extensibility
    Oxwall is flexible and extensible from the basics of it's architecture, i.e. it is built on a simple and compact core, and on plugins which bring all the functionality. Even standard platform features (user system, admin panel, etc) were developed as system plugins (system plugins can't be uninstalled). So in concern of extensibility Oxwall is one of the best places for implementing your ideas.
  • Performance
    Performance is getting really vital for modern web applications and frameworks. We have seen a lot of examples when framework/soft showed outstanding results with simple "Hello World" page and got to the chart bottom after real life tests. We developed Oxwall trying to avoid all bottlenecks and making it really fast and furious in real life site loads.

Concerning MVC in Oxwall - traditionally it includes models, views and controllers. Let's start with controller, which is the main player in the bunch - it processes routed request and responsible for taking user input, communicating with model and providing the data for view rendering. Model is responsible for interacting with database and implementing all the business logic. The model category in Oxwall includes two instances - service which is responsible for business logic and DAO (Data Access Object) which handles all the manipulations with database. The third player is a view, and it is represented by native HTML template with Smarty logic. In Oxwall the views receive only processed and ready for markup data, and they can contain only presentation logic.

Managers in Oxwall are represented by global objects to provide main functionality for plugin developers. There is a special static class for getting access to all managers - OW. Let's see several examples of managers usage.

  1. // adding css code to the page
  2. OW::getDocument()->addStyleDeclaration("body{background-color:#000;}");
  3. // generating URL
  4. OW::getRouter()->urlFor('BLOGS_CTRL_Base', 'index', array('listType' => 'latest'));
  5. // getting translated language value
  6. OW::getLanguage()->text('base', 'my_custom_lang_key');
  7. // getting root directory for blogs plugin
  8. OW::getPluginManager()->getPlugin('blogs')->getRootDir();

As you can see managers usage is very simple and convenient. After having learned the basics of plugin structure, managers usage and MVC model you will be able to create your own plugins for Oxwall.

It could've been a lot better but it could've been a lot worse

Oxwall is a result of hardworking and thorough development process of our team, lasting for more than 2 years. All the years of experience and customer feedback we got from the previous projects, we employed here and we managed to create a really efficient PHP 5 based software for building social projects.

Nowdays some of technics we used are criticized in many projects. For example we have a lot of global objects (singletons) in the application; all managers, DAO, service objects are built as singletons. Another hot issue for all PHP softs and frameworks is template engine. Today more and more projects prefer using native template systems (based on PHP). They claiming that native template are the fastest way to generate markup and in that that way you will have more opportunities in presentation logic using PHP. But not everybody plays benchmarks all day long and doesn't care at all if it's convenient for designers and template integrators. I've heard many times that they should at least know the basics of PHP, but it's not a right way - they want to have in templates more HTML and less of any other logic. As for me Smarty is much better than native PHP templates: we used Smarty for all our projects and it always performed template compiling in the best way.

For sure I can mention more disputable issues in Oxwall, but I want to assure you that we came to all the decisions during very hot debates and discussions. As I was telling you before we applied all our skills and experience to deliver the maximum value in our soft.

Final words

As you can see Oxwall is very young at the moment! It has unclosed bugs, still there is a lack of features and themes, poor support and you may have noticed the absolute lack of tech documentation; but I can assure you that with every new release it's getting better and better! This year we are going to figure out most part of these issues and I'm sure Oxwall will bring outstanding results for thousands of people all over the world!

I have started the blog in order to attract more web developers to the Oxwall platform. I hope my posts will be useful and will help them to dive into the amazing world of Oxwall. By the way I forgot to mention the basic requirements for entering the Oxwall developers world :) They are the same as for any PHP framework/soft: object oriented PHP, Javascript and HTML+CSS. Additionally Oxwall uses template engine Smarty, it's pretty simple - you will have just to get familiar with the documentation and you are ready to go.

Next post will be very soon, I'm going to tell you about Oxwall file structure and autoloading. Stay tuned!


     Blog home

Comments

Chirpn Admin Oct 23 '12
Thanks for the details Sardar. I had a quick question for you, I am trying to integrate Oxwall features into my existing Yii based application. Is there a quick way to integrate the features into Yii or would I need to manually go in and port the files over to work with the Yii MVC architecture?

Thanks
Aditya Mar 16 '13
That was a nice overview! What OW:: can do is a great discovery as well. But I see that you did not deliver on your promise for more articles very soon, because it has been over a year :) Finally, I think I agree with you on this: "It could've been a lot better but it could've been a lot worse"... us developers are so obsessed with perfection in everything that we lose sight of the ultimate goal sometimes: delighted users. I think you have tons of those in the Oxwall community, so congrats!

But I want to rehash one of my gripes here. Your development process is closed. Too closed for an open source project. I see from this post that you guys are not oblivious to the tons of other projects out there; why not follow their model and allow other coders to contribute? Use GitHub, Bitbucket or Gitorious and watch your work lessened as happy coders contribute bug fixes and security patches your tiny team can never find all alone...

Say Something

You need to sign in to comment

Browse by Tags

Rate

Your rate:
Total: (0 rates)

Archives