<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Agile Toolkit Blog</title>
	<atom:link href="http://agiletoolkit.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://agiletoolkit.org/blog</link>
	<description>library updates, tips, information and more</description>
	<lastBuildDate>Fri, 03 Aug 2012 14:45:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>The 25-minute video which could make you a dynamite web developer</title>
		<link>http://agiletoolkit.org/blog/the-25-minute-video-which-could-make-you-a-dynamite-web-developer/</link>
		<comments>http://agiletoolkit.org/blog/the-25-minute-video-which-could-make-you-a-dynamite-web-developer/#comments</comments>
		<pubDate>Fri, 03 Aug 2012 14:34:44 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Beginner tips]]></category>
		<category><![CDATA[Verison 4.2]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=927</guid>
		<description><![CDATA[Finally we have nailed it. After many attempts at making a half-decent screencast / tutorial, he have now created two amazing episodes, clean, structured and well articulated. We have also came up with a regular schedule for the up-coming recording. Agile Toolkit Tutorial #1 &#8211; A better web development Web development does not need to [...]]]></description>
			<content:encoded><![CDATA[<p>Finally we have nailed it. After many attempts at making a half-decent screencast / tutorial, he have now created two amazing episodes, clean, structured and well articulated. We have also came up with a regular schedule for the up-coming recording.</p>
<h3>Agile Toolkit Tutorial #1 &#8211; A better web development</h3>
<p>Web development does not need to be complex. You have reinvented the wheel way too many times. It&#8217;s time to reinvent web development altogether. The source of inspiration for Agile Toolkit &#8211; the new web development framework &#8211; comes from Desktop and Mobile application development and object oriented toolkits. Our first tutorial episode will give you a very brief, 25-minute introduction to this new framework and will highlight some of main benefits.</p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/eyeZhwP1LP4?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h3>Agile Toolkit Tutorial #2 &#8211; How to become a web developer</h3>
<p>You might have installed WordPress or Joomla for your friends, but have you thought about earning your living with Web Development? To became a successful web app developer you will need to be efficient. You must know how to build software quickly and how to improve it over time without compromises. This tutorial episode will guide you through a prototyping phase of the application. Putting together a basic screens and UI elements just to show to your client or investors is easy and fast in Agile Toolkit. The best part is that you will be able to continue and enhance your prototype until it becomes a fully-featured scalable web application / service.</p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/LQYAeYS1RT8?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h2>Take part in the next hangout</h2>
<p>We are recording Agile Toolkit Tutorials now on a weekly basis, every wednesday. If you have a microphone you can participate too. We use Google Hangout and ScreenFlow to record and edit episodes. Come along for the next one, <a href="https://plus.google.com/events/c50bbrv1d21sro7resmp69eaie0/105976746491820250883">register on our Google Event page</a>.</p>
<p>The next episode will focus on the awesome back-end features of Agile Toolkit &#8211; Active Record, Object Relational Manager, Multi-table Models and how to use full potential of your SQL database to build scalable web software.</p>
<p>If you can&#8217;t make it to the next one, come next wednesday 1:30 UK time (<a href="http://www.agiletech.ie/time/1:30">http://www.agiletech.ie/time/1:30</a>). This is a weekly event.</p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/the-25-minute-video-which-could-make-you-a-dynamite-web-developer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Video Introduction to Agile Toolkit</title>
		<link>http://agiletoolkit.org/blog/video-introduction-to-agile-toolkit/</link>
		<comments>http://agiletoolkit.org/blog/video-introduction-to-agile-toolkit/#comments</comments>
		<pubDate>Mon, 09 Jul 2012 10:59:59 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Beginner tips]]></category>
		<category><![CDATA[Verison 4.2]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=925</guid>
		<description><![CDATA[If you have heard about Agile Toolkit but haven&#8217;t shared with your developer friends yet, now is a great time. This video is a great introduction to the basics of Agile Toolkit starting from the very start. What is Agile Toolkit? Why was it created? What is it best for? How it compares to other [...]]]></description>
			<content:encoded><![CDATA[<p>If you have heard about Agile Toolkit but haven&#8217;t shared with your developer friends yet, now is a great time. This video is a great introduction to the basics of Agile Toolkit starting from the very start. What is Agile Toolkit? Why was it created? What is it best for? How it compares to other Web Frameworks?</p>
<p><a href="http://youtu.be/DimVEvuOm_g">http://youtu.be/DimVEvuOm_g</a></p>
<p>Your questions are answered and the guide gives a great taste of what can be done with Agile Toolkit just in a few moments. This is the first podcast in the series with a new episode scheduled every week.</p>
<p>We are recording episodes live and if you are willing to participate and ask questions, here is the link for the second episode event:</p>
<p><a href="https://plus.google.com/u/1/events/cr7rqaq57dp3aler6idsjrrrf6o/105976746491820250883">https://plus.google.com/u/1/events/cr7rqaq57dp3aler6idsjrrrf6o/105976746491820250883</a></p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/video-introduction-to-agile-toolkit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Language Under Attack</title>
		<link>http://agiletoolkit.org/blog/php-language-under-attack/</link>
		<comments>http://agiletoolkit.org/blog/php-language-under-attack/#comments</comments>
		<pubDate>Sun, 01 Jul 2012 12:20:16 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=920</guid>
		<description><![CDATA[http://www.codinghorror.com/blog/2012/06/the-php-singularity.html Jeff said it, PHP language sucks. But we use it. Why? It&#8217;s easy to install for new users. It&#8217;s a single PHP extension. And in most cases that&#8217;s all you need. It&#8217;s easy to read. Surely some new scary features have been creeping into, but why the hell do I want my integer to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codinghorror.com/blog/2012/06/the-php-singularity.html">http://www.codinghorror.com/blog/2012/06/the-php-singularity.html</a></p>
<p>Jeff said it, PHP language sucks. But we use it. Why?</p>
<ul>
<li>It&#8217;s easy to install for new users. It&#8217;s a single PHP extension. And in most cases that&#8217;s all you need.</li>
<li>It&#8217;s easy to read. Surely some new scary features have been creeping into, but why the hell do I want my integer to be an object?</li>
<li>It&#8217;s fast. Initially PHP was a collection of C routines. It naturally evolved to be a thin layer on top of C with it&#8217;s own language parser.</li>
<li>It&#8217;s safe. Problem with one application can&#8217;t impact others. No memory leaks. No runaway threads.</li>
<li>It&#8217;s flexible. Diversity and low standards is what makes Agile Toolkit possible to innovate new and exciting ways.</li>
<li>It&#8217;s transparent. You can actually pick the code and be able to follow what&#8217;s going on. Try to follow Ruby framework with all the overloading.</li>
<li>It&#8217;s scalable. It encourages developer to think in terms closer to low level languages.</li>
<li>It is usable on it&#8217;s own. You can actually develop web app in PHP without any 3rd party PHP code.</li>
<li>It gets job done. When a web app needs to be develop quickly for someone, nothing beats PHP.</li>
</ul>
<p>Different languages serve different purposes. Inconsistency in function naming? Oh, Cmon.</p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/php-language-under-attack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Object-Oriented MVC Web Programming</title>
		<link>http://agiletoolkit.org/blog/object-oriented-mvc-web-programming/</link>
		<comments>http://agiletoolkit.org/blog/object-oriented-mvc-web-programming/#comments</comments>
		<pubDate>Wed, 27 Jun 2012 23:32:45 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Beginner tips]]></category>
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=909</guid>
		<description><![CDATA[After I have personally whitened the transformation of computer industry with unification of User Interfaces (by Mac and Windows) which is possible through use of Object-Oriented programing techniques. Object-Oriented programming offers many powerful tools to a skilled developer. Similarly Model-View-Controler concept have proved to be easy to understand and use. Unfortunately the typical MVC implementation [...]]]></description>
			<content:encoded><![CDATA[<p>After I have personally whitened the transformation of computer industry with unification of User Interfaces (by Mac and Windows) which is possible through use of Object-Oriented programing techniques. Object-Oriented programming offers many powerful tools to a skilled developer. Similarly Model-View-Controler concept have proved to be easy to understand and use. Unfortunately the typical MVC implementation is not very object-oriented.</p>
<p>If you combine object-oriented principles with Model-View-Controller paradigm properly, this will result in a much more efficient web development environment. In this article I explain object-oriented principles can be combined with MVC paradigm.</p>
<p>NOTE: I am the author and maintainer of <a href="http://agiletoolkit.org/">Agile Toolkit</a>. Me and my colleagues have built Agile Toolkit according to the principles I describe here. This article, however, is for promoting the fundamental ideas. If you would like to see a fully-practical implementation of Object-Oriented MVC, read introduction to Agile Toolkit. You are also welcome to implement ideas described here in your favourite programming language / framework / development environment or simply extend your out-look and expand your vision of Software Development.</p>
<p><span id="more-909"></span></p>
<h2>Understanding Objects</h2>
<p>If you are unfamiliar with object-oriented programming, method overloading and abstraction, let me start with an example.</p>
<p>Suppose that you must develop an application which draws shapes on the screen. The shape you need to implement would be Circle, Square and Line. Each shape have a set of different properties such as dimensions, lengths etc. The way how each shape is drawn would also be different. Therefore we would define a base-class first:</p>
<p>[php]<br />
abstract class Shape {<br />
  public $x, $y;<br />
  abstract function draw();<br />
}<br />
[/php]</p>
<p>Afterwards you would extend this class to create Circle, Square and Line class. Each class would add some additional properties and implement draw() method differently. What is important is that you can abstract interactions with shape in the main body of your program. For example:</p>
<p>[php]<br />
foreach($shapes as $shape){<br />
  $shape-&gt;draw();<br />
}<br />
[/php]</p>
<p>Regardless of how many different shape classes we have defined, how complex they are and how many properties they hold, the code above will remain as it is. This principle is called <a href="http://en.wikipedia.org/wiki/Abstraction_(computer_science)#Abstraction_in_object_oriented_programming">Abstraction</a> and is often used in Object-Oriented application design.</p>
<h3>Composition</h3>
<p>The second important principle of Object-Oriented programming is Composition. That is ability of one object to rely on implementation of other objects to achieve it&#8217;s goal. Consider the following implementation of the &#8220;Square&#8221; class:</p>
<p>[php]<br />
class Square extends Shape {<br />
  private $lines;<br />
  function draw(){<br />
    $lines[0]-&gt;draw();<br />
    $lines[1]-&gt;draw();<br />
    $lines[2]-&gt;draw();<br />
    $lines[4]-&gt;draw();<br />
  }<br />
}<br />
[/php]</p>
<p>In this implementation, Square relies on four other line objects to do the job. Of course Square can also be implemented differently, but the important thing is that it re-uses other objects to achieve minimum code and simplify implementation of a Square.</p>
<p>Both principles work extremely well in Web development, but many developers neglect to use them on a regular basis.</p>
<h2>Planning Web Software with Object-Oriented approach</h2>
<p>When any new application or a system is designed, software architect tries to anticipate what kind of flexibility will be required from the software and will attempt to use some of the development paradigms (including those two I have described above) to improve flexibility and efficiency of the software.</p>
<p>Let&#8217;s walk through the typical web application and see what areas of the application we anticipate to be extended and will require flexibility.</p>
<h3>1. Data Model</h3>
<p>M in MVC stand for Model. Model is an object which represents piece of physical data in your application. This can represent User, Order, Record, Message and many other things. There are many great frameworks which will help you convert your SQL data-base into Model structure at the expense of losing ability to use some powerful tools of Object Oriented Programming:</p>
<ul>
<li>Generated Models typically will not use inheritance</li>
<li>Generated Models will not use abstraction</li>
<li>Generated Models will not use composition</li>
</ul>
<p>There are many cases when use of the methods will save you some grief and all you need to do is to learn and recognize them. Here are few examples:</p>
<h4>Inheritance: Publisher and Advertisers</h4>
<p>Suppose you build web application where some users can publish articles and other users can advertise on the sidebar. Both type of users pursue different goals and are permitted to do different functions. They do have, however, some things in common such as ability to change their password.</p>
<p>A skilled software architect would create a class for a &#8220;User&#8221; which then would be inherited by Publisher and Advertiser. Method for changing password would be described in the &#8220;User&#8221; class and will be inherited by both Publisher and Advertiser.</p>
<p>You can also create a User class which incorporated features of both Advertiser and Publisher, but then any change to Publisher logic might impact Advertisers making your project less stable. The project will also become less flexible and it wouldn&#8217;t be as easy to introduce a new class of users without affecting existing functionality.</p>
<p>Through proper use of object-oriented inheritance principle you can achieve a much better structure source code.</p>
<h4>Composition: Model Features</h4>
<p>Models can have certain features such as soft-delete or ability to produce audit records. This functionality can be implemented through a separate objects instead of making model support it all. This is where composition principle is used. Some ORM systems will allow you to &#8220;enhance&#8221; your model by incorporating additional features through 3rd party classes. With composition you can also define your own patterns and make use of other classes inside your model.</p>
<p>With composition you can implement field encryption, validation and behavior extensions &#8211; all of these are very useful for a flexible application.</p>
<h4>Abstraction: Generic Views</h4>
<p>Suppose you have two models: &#8220;User&#8221; and &#8220;Order&#8221;. They do have a different set of columns, operate with different data-sources and behave differently and would also contain different set of methods. However they might be based on a generic model class. This way some User-Interface code can assume certain things about your models.</p>
<p>The most basic things to assume is how to create, delete update and list records. However views could also extract information about model fields from the model in which case they can build tables and forms for you without the need to re-define them all again.</p>
<p>Your model can be used by a restful API implementation which will transparently support manipulation with any model your system has. More importantly, you can also produce up-to-date SOAP specifications on the fly without any intermediate code.</p>
<p>That is the power of Object-Oriented abstraction.</p>
<h3>2. User Interface</h3>
<p>Let&#8217;s now switch to the User Interface of your web application and try to find where the similar principles can be used and applied. It is more challenging to design Object-Oriented User Interface for web software, simply because everyone wants to have a unique design, but it is still doable.</p>
<p>Any user interface design will be based around some concepts. You would operate with things like frames, buttons, layouts, headers, boxes, pop-ups and so on. Each element could be described with a piece of HTML code and some logic code. Frame, for example, would have two dynamic areas &#8211; title and the content.</p>
<p>Commonly the MVC principle uses no Object-Oriented principles in building Views instead it relies on template engine to do all the work. Templates do allow you to perform includes but are not object-oriented in any way. You can&#8217;t inherit a template and pretty often virtualization principle is not working either. If you are using regular MVC approach, you end up losing the flexibility of object-oriented programming.</p>
<p>This can be solved by working with objects. Suppose our objects are: Frame, Button, Paragraph. Because we enjoy customization we would also need a object with a custom HTML template which we can call &#8220;View&#8221;. With Smarty templates often include one another. With objects we already have a great principle called composition.</p>
<h4>Composition: Form</h4>
<p>Probably the best UI component which relies on composition is Form. The form class on it&#8217;s own can do very little, however it relies on &#8220;Field&#8221; and &#8220;Button&#8221; classes.</p>
<p>Composition principle in software with Object-Oriented user interface would go beyond forms and will allow any view to be composed of other views.  A frame could contain a form. A form field could contain a button. Finally the page could also be an object.</p>
<p>We are not eliminating templates, but templates are now used by each object individually. You no longer include templates but you now incapsulate objects.</p>
<h4>Abstraction: Generation of HTML</h4>
<p>Ultimately any Web Software must produce a HTML output for browsers to work with. If our User Interface consists of objects, then we will have to rely on abstraction when generating HTML. This way we can ask Frame object to render() itself into HTML and Frame would rely on other object ability to produce HTML and so forth.</p>
<p>[php]<br />
echo $page-&gt;render();<br />
[/php]</p>
<h4>Inheritance: Widget customization</h4>
<p>Now that we are incapsulating objects and not templates, it&#8217;s much easier to produce general-purpose widgets which can be part of the page. Such widgets can communicate with other components or the system or even with JavaScript on the browser-side. But in addition to the selection of the base widgets it&#8217;s now extremely easy to add new widgets by inheriting existing ones. If you need to build a signup form, you extend a regular form then tweak some behavior and properties.</p>
<p>This approach to the project will promote creation of new components and their re-use. By extending widgets (views) and not adding more functionality into them you can keep basic performance fast and avoid creating un-stable code.</p>
<h3>3. Application Class</h3>
<p>After models are defined and the UI components are defined too, there are the binding element to it. That&#8217;s the application class. Application is typically a class which is responsible for doing EVERYTHING. Of course application class uses composition to divert implementation towards other classes. The Data-Model and User Interface is something I have mentioned already. However there might be some other classes, which are typically called Libraries.</p>
<h4>Inheritance: Multiple API classes.</h4>
<p>Application must be a valid objects. It should be possible to create several instance of application object and also have ability to inherit applications. One application may be focused around serving one user segment and other application could be used for website administration purposes. Some API classes may be focused to be called from command-line or from scheduler. Other API may produce HTML, XML or JSON output.</p>
<h4>Composition: Implementing Routing</h4>
<p>A web application must respond to different URL formats and connect them to different classes. How the mapping is done is defined through &#8220;Routing&#8221;. For example http://example.com/testpage/ might be routed to a class called &#8220;page_testpage&#8221;. Ability to divert page-specific functionality into page classes is implementation of composition in Web Application front-controller.</p>
<p>The principle, however, is depending on the nature of API used. Command-line API typically do not require routing. Implementation of RESTfull API can be implemented by connecting to models directly.</p>
<h4>Abstraction: Application Roles</h4>
<p>There are many general web application categories such as Content Management Systems, eCommerce solutions, Ticket systems. Certainly you can implement a ticket-system. However &#8211; can you deliver such a system as an abstract class which could then be further extended?</p>
<p>Majority of MVC frameworks would not allow to do that. This is an incredibly powerful concept which can create a more flexible closed-source web software distribution, implement a stable multi-interface web system and even build one open-source project on top of another with a very tight integration and minimum overheads.</p>
<h2>The Object-Oriented MVC</h2>
<p>Here I have described my view of Object-Oriented MVC. Models fully capable of all object-oriented features. Views implemented as objects, not templates relying on object-oriented features. Finally the application which controls all of the process yet will not take away any of the advanced object-oriented techniques.</p>
<p>Object Oriented development offers a powerful concepts used by majority of developers word-wide. Web Frameworks usually restrict developers and take away power of Object-Oriented development. Only by combining and designing a web framework from the ground-up to permit and use full power of object-oriented programming maximum web development efficiency can be achieved. But not without some learning.</p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/object-oriented-mvc-web-programming/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Migration from 4.1.3 to 4.2 (by Jancha / Ambient Technologies)</title>
		<link>http://agiletoolkit.org/blog/migration-from-4-1-3-to-4-2-by-jancha-ambient-technologies/</link>
		<comments>http://agiletoolkit.org/blog/migration-from-4-1-3-to-4-2-by-jancha-ambient-technologies/#comments</comments>
		<pubDate>Sat, 16 Jun 2012 12:52:45 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Beginner tips]]></category>
		<category><![CDATA[Verison 4.2]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=907</guid>
		<description><![CDATA[Janis Volbergs and his web development company (Ambient Technologies) have been one of early adopters and supporters of Agile Toolkit. He have been using it before first 4.0 versions even went public year and a half ago. Recently Janis have started his own blog, where he shares some of his own experiences with Agile Toolkit. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://twitter.com/#!/jancha" target="_blank">Janis Volbergs</a> and his <a title="HTML5 Web and Mobile Applications, Agile Toolkit Developer" href="http://www.ambienttech.lv/" target="_blank">web development company (Ambient Technologies)</a> have been one of early adopters and supporters of Agile Toolkit. He have been using it before first 4.0 versions even went public year and a half ago. Recently Janis have started his own blog, where he shares some of his own experiences with Agile Toolkit.</p>
<p>In his last blog post Janis is explaining his experience in migrating from 4.1 to 4.2 and all the necessary changes he had to make for one of his internal applications. <a href="http://www.ambienttech.lv/blog/2012-06-11/migrating_from_agile_toolkit_4.1.3_to_4.2.html" target="_blank">Read the full blog on his blog: Migrating from Agile Toolkit 4.1.3 to 4.2 master branch. Notes.</a></p>
<p><strong>Update: </strong>Today <a title="Web Development Example with Agile Toolkit" href="http://www.ambienttech.lv/blog/2012-06-16/all_about_list_selectors.html" target="_blank">there is a new post looking into details how to best use list-type fields: dropdown, checkbox lists and radio buttons</a> along with some screenshots.</p>
<p>Please help me encourage Janis in writing more blog posts. I would certainly be interested in hearing about the Content Management System he have built.</p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/migration-from-4-1-3-to-4-2-by-jancha-ambient-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which PHP Framework is the fastest?</title>
		<link>http://agiletoolkit.org/blog/which-php-framework-is-the-fastest/</link>
		<comments>http://agiletoolkit.org/blog/which-php-framework-is-the-fastest/#comments</comments>
		<pubDate>Tue, 05 Jun 2012 11:41:49 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=904</guid>
		<description><![CDATA[This question is often asked, but is never answered properly. So how to measure framework speed? Let me also explain why &#8220;scalability&#8221; is more important than general &#8220;performance&#8221;. The primary goal of Frameworks and Libraries is to make certain things simpler and easier for developers. Frameworks can also be categorized by what it is they&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>This question is often asked, but is never answered properly. So how to measure framework speed? Let me also explain why &#8220;scalability&#8221; is more important than general &#8220;performance&#8221;.<br />
<span id="more-904"></span>The primary goal of Frameworks and Libraries is to make certain things simpler and easier for developers. Frameworks can also be categorized by what it is they&#8217;re simplifying:</p>
<ul>
<li>MVC Frameworks help you organize flexible page structure</li>
<li>Database frameworks (also called ORM) help you to organize flexible database access interface</li>
<li>User Interface frameworks will help you make your user interface consistent</li>
<li>Security frameworks will help you introduce security practices in your software.</li>
</ul>
<p>Frameworks do that by introducing some assumptions, generalizing and also restricting developer to certain practices which framework authors approve of.</p>
<p>It&#8217;s fairly obvious to anyone than adding thousands of lines of code to your  &#8221;Hello World&#8221; application wouldn&#8217;t make it execute faster. The regular argument of a framework authors is that they help development process to be faster and smoother on a larger projects. This often nothing to do with the speed of the code execution: &#8220;Developer time is more expensive than CPU time&#8221;.</p>
<p>What&#8217;s worse is that some frameworks impose standards which slow your code down. An example is a basic Acitve Record implementation, which brings your powerful SQL engine to the level of Simple DB to match the lowest common feature denominator across multiple database vendors. This along with a general overheads of the framework greatly contributes to the &#8220;slowness&#8221; of your project.</p>
<p>So how can framework contribute to performance of your project?</p>
<h2>1. Make Fewer SQL Queries</h2>
<p>When your frameworks sends request to a database and waits for result, it introduces latency. The PHP code waits for data to be parsed and executed by SQL and results to be returned. Because today SQL is still the most popular way then your job is to make as little queries as possible. If you could build your page with 10 SQL queries instead of 50, that would speed things up a lot.</p>
<p>Having less number of queries means each query would be more complex and would retrieve more data. Yet we don&#8217;t want to write the queries. Your database framework will have to have concept of expressions, joins and sub-selects to be able to off-load as much logic as possible into SQL engine. If number of queries on your page increases along with number of records displayed on the page, then you have produced non-scalable code. If your framework endorses this practice, then your framework is not scalable.</p>
<h2>2. Selective render</h2>
<p>When you look at the page such as this one you see many different areas with many different types of dynamic data. As it happens with dynamic web pages, some areas of your screen will refresh themselves. There are two approaches to do so</p>
<ol>
<li>Build a separate JSON service for sending updates</li>
<li>Let framework handle the refresh</li>
</ol>
<p>The (2) is very tempting, but average frameworks can&#8217;t perform web page refreshes graciously, that&#8217;s why many developers will have to duplicate some code and build a separate mechanism for JSON polling. This introduces inconsistence and bugs in the user interface. Many developers resort ONLY to JSON polling after the page is loaded increasing number of dynamic requests, making page unusable for search engines, building reliance on javascript and severely reducing total page load time.</p>
<p>For a scalable framework it&#8217;s an absolute necessity that the fragment of the page could be inexpensively re-rendered and reloaded with as little database traffic as possible and without additional coding from developer.</p>
<h2>3. Parallelization</h2>
<p>Suppose you have two different API services behind your web frontend. One service is built to return JSON with list of on-line users. The other service returns the JSON with recent post feed. Your frontend is written in your favorite PHP framework which makes use of templates or some page logic to determine if any of those page areas (or both) needs displaying.</p>
<p>JSON backend introduce some serious latency in your request, so it&#8217;s imperative that you your frontend PHP framework would execute both requests in parallel. Unfortunately most of the PHP frameworks want the data pretty much right away, when the page is rendered.</p>
<p>A scalable framework would be capable of identifying which widgets you need to display on your page and allow to execute both JSON requests first before collecting their output.</p>
<h2>4. Overheads</h2>
<p>Minimization of overheads is often the ONLY practice frameworks concern themselves with. This is where modularity is important. Let&#8217;s say the developer X have built a plug-in for WordPress. He decided to use super-fast framework and throughly benchmarked his add-on. Next comes the developer Y who have also built a plug-in for WordPress with a different framework but equally as fast. WordPress now requires to initialize two frameworks introducing huge overheads.</p>
<p>You might have been seen this in practice with a different set of frameworks, such as Zend and CodeIgniter. And then you integrate Facebook API which does not rely on any framework and makes you chew through thousands of line of PHP code which you don&#8217;t need anyway. And you also use ORM of your choice which has no dependencies yet re-implements tons of code.</p>
<p>A scalable framework should provide a unified set of modules and practices which are used by all of the plug-ins and add-ons to avoid any code duplication. In practice, decoupled frameworks are very bad for scalability. How many frameworks would provide add-on developer with a consistent API for building user interface?</p>
<h2>5. Caching</h2>
<p>After making all the possible mistakes in the book, frameworks do implement a caching strategy and brand themselves as a &#8220;High Performance&#8221;. The caching is not a cure and will introduce complications and limitations. Framework must be fast and scalable without any caching. Yet caching is important too. There are two types of caches: data cache and output cache.</p>
<p>The data cache helps developer to skip some database queries. If your implementation requires you to traverse models on each row (such as to determine URL for user thumbnails), then adding a memcache seems like a good-enough solution to the problem. This does help scalability a little, but essentially displays outdated data and can lead into many nasty problems.</p>
<p>Output caching helps you to cache either parts of the page or all the page completely. Many MVC frameworks wouldn&#8217;t have sufficient support for implementing output caching, because they are used to &#8220;echo&#8221; things out. As developer it becomes your burden to collect output into buffer and build logic for substitution and keeping cache up-to-date.</p>
<p>A scalable framework should handle both tasks flexibly and consistently. It should allow you to exchange your expensive data source (SQL, JSON) with a faster data source such as Memcache gracefully and transparently.</p>
<p>The framework should be equally good at letting you substitute whole areas of the page with a static alternatives without loosing functionality and requiring you to go under the hood of page routing or loosing any dynamic functionality on your page.</p>
<h2>Conclusion</h2>
<p>Many PHP frameworks sucks at properly understanding scalability principles. Look into a Silex framework and imagine that your project has 200 pages. On every page request, it will execute 200 matching pattern checks which are NOT based on regular expression. How is that scalable? Possibly another caching would help?</p>
<p>I am saddened by the state in which PHP frameworks are today and I believe there are many things which can be improved. I also believe that developers can be educated to have a good judgement and understanding of scalability.</p>
<p>There is huge potential for the next generation of PHP frameworks and I strongly encourage you to write and talk about it.</p>
<p>So should someone ask you, &#8220;what PHP framework is the fastest&#8221; — tell them that they are all slow, but some of them are &#8220;scalable&#8221;.</p>
<p>I have implemented all of the scalability principles described above in my framework: <a title="Agile Toolkit Framework" href="http://agiletoolkit.org/">http://agiletoolkit.org/</a> but if you have a worthy alternative be sure to leave a comment with some clarifications.</p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/which-php-framework-is-the-fastest/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Why Your Active Record Implementation is Example of a Poor Software Design?</title>
		<link>http://agiletoolkit.org/blog/best-active-record-in-php/</link>
		<comments>http://agiletoolkit.org/blog/best-active-record-in-php/#comments</comments>
		<pubDate>Sun, 13 May 2012 22:06:27 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Beginner tips]]></category>
		<category><![CDATA[Verison 4.2]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=893</guid>
		<description><![CDATA[Through Agile Toolkit I&#8217;m sharing with the world my improved vision for a better Active Record Implementation. I believe that the widely popular Active Record implementations are examples of a bad software design. Here is the reason. What is Active Record? Active Record pattern have been hugely popular due to adoption in Ruby on Rails [...]]]></description>
			<content:encoded><![CDATA[<p>Through Agile Toolkit I&#8217;m sharing with the world my improved vision for a better Active Record Implementation. I believe that the widely popular Active Record implementations are examples of a bad software design. Here is the reason.</p>
<p><span id="more-893"></span></p>
<h3>What is Active Record?</h3>
<p>Active Record pattern have been hugely popular due to adoption in Ruby on Rails and in other frameworks. (<a href="http://en.wikipedia.org/wiki/Active_record_pattern#Implementations">Active Record explained on wikipedia</a>). Typically a class is generated based on the database table schema. All the fields of the database are reflected as properties of the model. Class has several constructors allowing to load model directly by ID or search for records. Only one record can be loaded at a time.</p>
<h2>Why Classic Active Record is Broken?</h2>
<h3>No Testability</h3>
<p>When the object is created, constructors does not accept reference to the database engine. Instead, they manage to pull it from some global namespace. That makes it very difficult to use Active Record with multiple database configuration or for testing.</p>
<h3>Static methods / Constructors</h3>
<p>A static method of a class which creates new instance of that class is called &#8220;constructor&#8221;. With Active Record there are multiple constructors present which can load record in a different ways. Number of constructors depend on the table structure in some implementation such as loadByCode() would only be applicable if &#8220;code&#8221; field exists.</p>
<h3>Abusive properties</h3>
<p>Potentially table can contain any field therefore model may have no &#8220;reserved&#8221; properties. That makes it virtually impossible to build any decent logic in the abstract model class.</p>
<h3>Code generation = duplication</h3>
<p>I am always amazed how same people preach about code re-use and how awful it is to copy-paste your code and then use code generators which effectively build thousands of lines of code for them. It might look good in your versioning system, but it is a very bad development practice.</p>
<h3>One table = one class</h3>
<p>While frameworks typically allow you to specify &#8220;parent class&#8221; in the YAML definition, in practice it is rarely used. We know that sometimes one table may contain different entity types, but Active Record implementations does not help in separating them into different classes.</p>
<h3>Operations with multiple records</h3>
<p>By definition Active Record object can hold one record only. If you need to iterate through multiple records you will end up creating and destroying objects, which introduces performance overheads.</p>
<h3>Lack of conditioning</h3>
<p>Active Record typically allow to load ANY record present in the table. It&#8217;s virtually impossible in many implementation of Active Record to restrict loading to certain types of data. That is, for example, implementation of soft-deletion. Implementing it often is <a href="https://github.com/technoweenie/acts_as_paranoid/blob/master/lib/caboose/acts/paranoid.rb">a major effort</a>.</p>
<h2>Recipe for an Improved Active Record</h2>
<h3>Dependency Injection</h3>
<p>There might be many variables model may require. Database driver object is one thing, but it might also require some other information. Specifying multiple objects for constructor is troublesome and inconsistent. My suggestion is to specify just one object which contains links to other necessary resources.</p>
<p>This object can be passed through the factory class. I have solved this problem having each object carry reference to such an object and whenever new object is created, it also receives that reference. That is a &#8220;api&#8221; class which can be used to reference database connection: $this-&gt;api-&gt;db. In practice, there may be multiple API classes, which makes it possible to inject dependency into any object.</p>
<h3>Avoiding Constructors</h3>
<p>If a model object could have a state where it is not associated with the database record, then the same object could be reused multiple times. If object is created first and then load() method is used to load new record from database then it can be subsequently called to add more records without the need to create model instance every time.</p>
<p>That means other methods can be used for loading data. As developer you may define new methods for data loading in your model classes which would override default methods.</p>
<h3>Avoiding using properties for fields</h3>
<p>In a database one field usually is a primary key. In most cases it&#8217;s called &#8220;id&#8221; but not always. If we want to introduce a property in our model, which will always refer to this primary key it may clash with non-primary key in a classic implementation of Active Record.</p>
<p>Fortunately PHP objects can also act as arrays. By using $model['name']=&#8217;John&#8217; the requests can be easily routed and saved inside internal array without polluting all of model property namespace. The $model-&gt;id then can always contain value of record&#8217;s primary key. Other operations are possible through methods set() and get(). $model-&gt;set($array);</p>
<p>In this implementation other model properties can be used internally by model business logic without affecting any fields.</p>
<h3>Avoid Code Generation</h3>
<p>Now that we have freed up properties of the Model class, we no longer need code generation. In fact we can configure model fields through PHP and store more meta-information for each field.</p>
<p>Not only that, but adding fields dynamically is now possible by using addField method. Native PHP calls are faster then using PHP to parse other file format. Native PHP is also more powerful and can allow you to define fields much more flexibly.</p>
<h3>One table = Many Classes</h3>
<p>Now we can inherit our models and add additional models and change behavior for the newly created classes. No longer there is one-to-one relation. You can also remove some field definition in your sub-classes if the field is not used for that business case.</p>
<p>Now you can create models for &#8220;User&#8221;, &#8220;Admin&#8221; and &#8220;Moderator&#8221; based on the same code-base and the same database table. Moderator, however, would have more methods/actions and might as well be able to address more fields in a table.</p>
<p>Ability to extend Models is a powerful strategy. It allows you to leave your existing code intact, but add a new model for your new use-cases. This greatly helps you to reduce amount of testing you need to perform after structural change of your database.</p>
<h3>Operation with multiple rows</h3>
<p>Now that the active record object have a state with no data, it can also be used as iterator through multiple records. What is great about our implementation is that for each iteration we simply need to load data from PDO into our internal array.</p>
<p>But let&#8217;s also add ability for a model to have conditions, which are automatically applied when loading data. By using conditions you can narrow down the selection of a model. Some models can even have default conditions, such as &#8220;Admin&#8221; model would only iterate through records with is_admin=&#8221;Y&#8221;.</p>
<h3>Full Conditioning</h3>
<p>With the availability of transactions, we can now insert record into the database and then attempt to load it. If existing model conditions will let record to be loaded, then it was saved properly. Otherwise the newly saved model does not conform to the conditions and transaction must be canceled.</p>
<p>With this the model of &#8220;Admin&#8221; can no longer save non-admin users into the database. Full conditioning now gives us a great assurance that any widget, piece of code or any developer working with Admin model would have no way to bypass some of the restrictions.</p>
<p>What&#8217;s even more valuable in SaaS applications is the ability to introduce condition based on a currently-logged-in user. Removing the need to always check for record author and having it done automatically is a great piece of mind for the security focused people.</p>
<h2>Agile Toolkit delivers Improved Active Record Approach and more</h2>
<p>Model implementation in Agile Toolkit offers all of the solutions described above and much more including Joins, Expressions, Traversing and Behaviors. Found out more: <a href="http://agiletoolkit.org/doc/modeltable">http://agiletoolkit.org/doc/modeltable</a></p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/best-active-record-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Framework for Professional, Enterprise and Scalable development</title>
		<link>http://agiletoolkit.org/blog/a-framework-for-professional-enterprise-and-scalable-development/</link>
		<comments>http://agiletoolkit.org/blog/a-framework-for-professional-enterprise-and-scalable-development/#comments</comments>
		<pubDate>Tue, 08 May 2012 22:32:14 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=891</guid>
		<description><![CDATA[Have you seen some potential in Agile Toolkit? If you are still unsure if you should adopt it in your critical product, read the following introduction to Agile Toolkit. This introduction is oriented at senior software engineers and describe some of the problems Agile Toolkit will help you solve in the long run. Read More&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Have you seen some potential in Agile Toolkit? If you are still unsure if you should adopt it in your critical product, read the following introduction to Agile Toolkit. This introduction is oriented at senior software engineers and describe some of the problems Agile Toolkit will help you solve in the long run.</p>
<p><a title="Read More" href="http://agiletoolkit.org/learn/understand/wiz">Read More&#8230;</a></p>
<p>Or</p>
<p><a title="Agile Toolkit Presentation" href="http://public.iwork.com/document/?d=Agile_Toolkit_Present_2012.key&amp;a=p102985462">Watch Presentation Slides&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/a-framework-for-professional-enterprise-and-scalable-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agile Toolkit 4.2 is Released!</title>
		<link>http://agiletoolkit.org/blog/agile-toolkit-4-2-is-released/</link>
		<comments>http://agiletoolkit.org/blog/agile-toolkit-4-2-is-released/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 14:31:00 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Core changes]]></category>
		<category><![CDATA[Verison 4.2]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=882</guid>
		<description><![CDATA[Agile Toolkit 4.2 is now available to download from http://agiletoolkit.org/. This release is the result of a half year effort and is based on the feedback we have received on 4.1 version. It brings a lot of improvements and enhancements but the primary goal is to create a fully transparent and fully-documented underlying architecture and [...]]]></description>
			<content:encoded><![CDATA[<p>Agile Toolkit 4.2 is now available to download from http://agiletoolkit.org/.</p>
<p>This release is the result of a half year effort and is based on the feedback we have received on 4.1 version. It brings a lot of improvements and enhancements but the primary goal is to create a fully transparent and fully-documented underlying architecture and promote extensibility through add-ons. The syntax of a new version is compatible with 4.1 with some exceptions outlined in our <a title="Upgrade Notes for Agile Toolkit 4.2" href="http://agiletoolkit.org/whatsnew/4-2">upgrade notes</a>.</p>
<p>If you are new to Agile Toolkit — <a title="Interactive Introduction" href="http://agiletoolkit.org/intro/1">follow to our interactive introduction</a>.</p>
<h3>New Data Model</h3>
<p>Agile Toolkit have always had a powerful ORM manager, but the Active Record support was lacking. With 4.2 the base classes for Models and Relational Models are completely rewritten. The new structure is much more extensible and efficient. The syntax has been simplified considerably.</p>
<p>The Agile Toolkit have been well received in the small companies and with new release it now targets medium companies. Support for variety of relational databases now includes SQLite, PostgreSQL and can be extended very easily for any database supported by underlying PDO architecture. Agile Toolkit now also have a set of models which can be used with no-SQL databases, caches and transparent APIs.</p>
<p>Support for additional databases, techniques and protocols will be coming through add-ons.</p>
<h3>New CSS Framework</h3>
<p>Although the interface retains the similar look, the underlying CSS framework is now much more powerful. It&#8217;s been re-writen using lessCSS and is based on 12-column grid system. CSS classes are much easier to use and build your interface with. The alteration of the look can also be easily achieved, things like line radius, spacings, number of columns, footer behavior can be very easily changed through a very simple CSS configuration file.</p>
<h3>New Add-on architecture</h3>
<p>With the version of 4.2 minimum requirement for PHP is now 5.3. That enables the use of namespaces. With namespaces developing add-ons for Agile Toolkit is pure enjoyment. You will find a add-on developer guide on our documentation site, but what&#8217;s really important is that your add-on can rely on core user interface, other addons and contain both the library and UI elements. This makes it possible for addons to be quite awesome. Developer of payment gateway can now provide developers with the actual payment form instead of set of functions written in the low-level PHP.</p>
<h3>Fully Documented</h3>
<p>Agile Toolkit is coming from a closed-source environment. It was initially designed to be used within our web development company: <a title="Web App development Ireland UK" href="http://agiletech.ie/">Agile Technologies</a>. We have <a href="http://agiletoolkit.org/blog/why-i-created-agile-toolkit/">open-sourced our Agile Toolkit in early 2011</a> but it is only now that the documentation have matured enough for wide adoption.</p>
<h3>Become Agile!!</h3>
<p>For all web developers either freelancers or working for the companies <a title="Benefits of Using Agile Toolkit" href="http://agiletoolkit.org/commercial/benefits">there are many reasons</a> for using Agile Toolkit in your next project or in your company. If you need to look at some project examples, <a href="http://allianceindependentauthors.org/">here</a> <a href="http://my-tools.ie/">are some</a> <a href="http://www.elexu.com/">example</a> <a href="http://www.invest-game.com">sites</a> launched recently and built completely in Agile Toolkit. If your project has already started why not:</p>
<ul>
<li>develop Administrative Back-end using Agile Toolkit to save time.</li>
<li>re-build your model structure on Agile Toolkit ORM and improve security.</li>
<li>use Agile Toolkit for serving static pages and improve speed.</li>
</ul>
<p>If you are in the need of custom web development using Agile Toolkit, consultancy, training or add-on development — <a href="http://www.agiletech.ie/contact/">our experienced team can offer you great solution</a> (we are now based in <strong>London, UK</strong>)</p>
<h3>We are hiring!</h3>
<p>Are you looking to join a great team to join which values great software design and your artistic programming skills? Would you want to collaborate as a part-time freelancer or a full-time employee? We have some great employment offers and real projects you can join. Contact jobs at agiletoolkit.org.</p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/agile-toolkit-4-2-is-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Development Mailing List / Group Launched</title>
		<link>http://agiletoolkit.org/blog/development-mailing-list-group/</link>
		<comments>http://agiletoolkit.org/blog/development-mailing-list-group/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 16:27:20 +0000</pubDate>
		<dc:creator>Romans</dc:creator>
				<category><![CDATA[Verison 4.2]]></category>

		<guid isPermaLink="false">http://agiletoolkit.org/blog/?p=879</guid>
		<description><![CDATA[I would like to welcome anyone who wants to participate in brain-storming and helping with some testing of 4.2 into our new google group: https://groups.google.com/forum/#!forum/agile-toolkit-devel You can learn a lot buy learning fundamentals of Agile Toolkit.  I&#8217;m starting from the very bottom layers of the framework, so join in quick!]]></description>
			<content:encoded><![CDATA[<p>I would like to welcome anyone who wants to participate in brain-storming and helping with some testing of 4.2 into our new google group:</p>
<p>https://groups.google.com/forum/#!forum/agile-toolkit-devel</p>
<p>You can learn a lot buy learning fundamentals of Agile Toolkit.  I&#8217;m starting from the very bottom layers of the framework, so join in quick!</p>
]]></content:encoded>
			<wfw:commentRss>http://agiletoolkit.org/blog/development-mailing-list-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
