Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add comparison

  • Loading branch information...
commit 610083d3632a77f4775d0f8b5690932c2d82c469 1 parent db7fcb1
Romans Malinovskis romaninsh authored

Showing 2 changed files with 337 additions and 0 deletions. Show diff stats Hide diff stats

  1. +326 0 page/compare.php
  2. +11 0 templates/default/page/compare.html
326 page/compare.php
... ... @@ -0,0 +1,326 @@
  1 +<?php
  2 +class page_compare extends Page {
  3 + function init(){
  4 + parent::init();
  5 +
  6 + $f=$this->add('Form',array('default_controller'=>'MyForm'));
  7 +
  8 + $f->setClass('stacked');
  9 +
  10 + $f->setModel('FrameworkComparison');
  11 +
  12 +
  13 + }
  14 + function defaultTemplate(){
  15 + return array('page/compare');
  16 + }
  17 +}
  18 +
  19 +class Controller_MyForm extends Controller_MVCForm {
  20 + function importField($field){
  21 + $formfield=parent::importField($field);
  22 + if(!$formfield)return $formfield;
  23 +
  24 + $field=$this->model->getElement($field);
  25 +
  26 + if($field->hint()){
  27 + $formfield->setFieldHint($field->hint());
  28 + }
  29 +
  30 + if($field->subtitle()){
  31 + $formfield->owner->add('Order')
  32 + ->move($formfield->owner->add('H3')->set($field->subtitle()),'before',$field)
  33 + ->now();
  34 + }
  35 +
  36 + if($field->intro()){
  37 + $formfield->aboveField()->add('P')
  38 + //$formfield->owner->add('Order')
  39 + //->move($formfield->owner->add('HR'),'before',$field)
  40 + //->move($formfield->owner->add('P')
  41 + ->set($field->intro())
  42 + ;
  43 + //,'before',$field)
  44 + //->now();
  45 + }
  46 + $formfield->owner->add('HR');
  47 +
  48 + }
  49 +
  50 +}
  51 +
  52 +class ComparisonField extends Field {
  53 + public $hint=null;
  54 + public $intro=null;
  55 + public $subtitle=null;
  56 +
  57 + function hint($t=undefined){ return $this->setterGetter('hint',$t);}
  58 + function intro($t=undefined){ return $this->setterGetter('intro',$t);}
  59 + function subtitle($t=undefined){ return $this->setterGetter('subtitle',$t);}
  60 +
  61 +}
  62 +
  63 +class Model_FrameworkComparison extends Model_Table {
  64 + public $table='framework_comparison';
  65 + public $field_class='ComparisonField';
  66 + function init(){
  67 + parent::init();
  68 +
  69 + $this->addField('name')
  70 + ->caption('Name of compared framework');
  71 +
  72 + $this->addField('version')
  73 + ->caption('Major version number if applicable')
  74 + ->hint('Use only for major versions such as "1.x", "2.x"')
  75 + ;
  76 +
  77 + $this->addField('date')
  78 + ->caption('Date');
  79 +
  80 + $this->addField('language')
  81 + ->caption('Programming Language');
  82 +
  83 + $this->addField('innovation')
  84 + ->subtitle('Raw Feature Comparison')
  85 +
  86 + ->intro('Every author of a framework follows one of the two paths. He is either implementing ideas he have "borrowed" in other frameworks or he is innovating his own path. Agile Toolkit has a unique architecture which is not used in any mainstream softawre. What about your framework? Does it bring something fresh and unique to the mix?')
  87 + ->caption('Can your framework be considered a "game-changer"?')
  88 + ->hint('Small and minor features do not count')
  89 + ->type('boolean')
  90 + ;
  91 +
  92 + $this->addField('self_sufficient')
  93 + ->intro('Some frameworks are dependant on other frameworks or PHP libraries, while other frameworks are self-sufficient and solve all of the generic problems themselves. If framework is not self-sufficient it must rely on API compatibility, release schedules, stability and security of the other code.')
  94 + ->caption('Is it common for your framework to be used stand-alone without mixing with other frameworks?')
  95 + ->hint('Only Server-Side software should be considered here')
  96 + ->type('boolean')
  97 + ;
  98 +
  99 + $this->addField('object_oriented')
  100 + ->intro('Object-oriented programming is based around concepts such as inheritance, polymorphism, modularity, encapsulation and abstraction. While some frameworks claim that they are Object-Oriented, they are not usign all of the concepts. Primarily they only rely on class inheritance and static methods. In other cases, frameworks use object-orientation but developers are not encouraged to produce object-oriented code.')
  101 + ->caption('Is your framework using Object-Orientation to the fulliest?')
  102 + ->hint('Ask yourself - is it typical that developer would build hierarchy out of controllers or models?')
  103 + ->type('boolean')
  104 + ;
  105 +
  106 +
  107 + $this->addField('conceptual_age')
  108 + ->intro('Some frameworks have been around for longer. Often frameworks change names and change add new concepts. However the fundamentals of the framework come a long way through many years. How old are the foundation of your framework?')
  109 + ->caption('Age of the concept in years')
  110 + ->hint('If your framework copies other framework, then put the age of that other framework')
  111 + ;
  112 +
  113 +
  114 + $this->addField('rewrite_age')
  115 + ->intro('Other frameworks have been used for years without major rewrite. Rewrite does not necessarily have to be full. Some part of the framework could be rewritten. Rewrites are good as they consider developer feedback and make things generally better at the expense of backward compatibility')
  116 + ->caption('When was the last major rewrite?')
  117 + ;
  118 +
  119 + $this->addField('sql_power')
  120 + ->intro('One of the most popular way to manage data is SQL database. SQL is a language which produces performance-efficient queries for necessary data. Some frameworks abstract and restrict developers from using efficient SQL queries.')
  121 + ->caption('Does your framework allow developer to use full power of joins, sub-selects and expressions?')
  122 + ->type('boolean')
  123 + ;
  124 +
  125 + $this->addField('model')
  126 + ->intro('Ability to address database through a model is great. Active Record can address records through native objects. Can your framework do that?')
  127 + ->caption('Support for active-record')
  128 + ->type('boolan')
  129 + ;
  130 +
  131 + $this->addField('ui_form')
  132 + ->intro('UI components in a framework can save developer a lot of time. Would your framework be able to display a form to a user based around the model fields?')
  133 + ->caption('Built-in Form Widget')
  134 + ->hint('If it is mandatory to write HTML or copy POST data into model, then do not tick this')
  135 + ->type('boolean')
  136 + ;
  137 +
  138 + $this->addField('ui_universality')
  139 + ->intro('Imagine you have just implemented a form on a page. Can you copy-and-paste your code to have two forms now?')
  140 + ->caption('Universal UI')
  141 + ->hint('If you would need to rename fields or worry about collision between forms, do not tick this')
  142 + ->type('boolean')
  143 + ;
  144 +
  145 + $this->addField('model_multitable')
  146 + ->intro('Often business data is stored in multiple tables. For example "user" and "contact_info" may be related tables. If your framework contains active-record implementaiton, can both tables be expressed by a single model? This way database design can be independent from the UI')
  147 + ->caption('Support for multi-table models')
  148 + ->type('boolean')
  149 + ;
  150 +
  151 + $this->addField('model_multitable_add_delete')
  152 + ->intro('If framework model support multiple tables, would creating new model entry populate both tables and link them with ID? What about deleting?')
  153 + ->caption('All c-r-u-d operations with multi-table model')
  154 + ->type('boolean')
  155 + ;
  156 +
  157 + $this->addField('model_conditions')
  158 + ->intro('If you are building a multi-user environment where all the data tables contain "user_id" field. User may only manage records which are labeled with his ID. Can this restriction be implemented on a model level in your framework?')
  159 + ->caption('Model support for conditions')
  160 + ->type('boolean')
  161 + ;
  162 +
  163 + $this->addField('model_traversal_conditions')
  164 + ->intro('If I have a model for "author". Can I traverse one-to-many relations? An example would be where I would get a "Book" model which would give me access only to the book of particular author')
  165 + ->caption('Model one-to-many traversal')
  166 + ->type('boolean')
  167 + ;
  168 +
  169 +
  170 + $this->addField('query_builder_abstraction')
  171 + ->intro('If your framework contains query builder. To enhance functionality of query-builder developer extends the class. Can the extended version of a class be used instead througought some parts of your framework?')
  172 + ->caption('Query Builder Abstraction')
  173 + ->type('boolean')
  174 + ;
  175 +
  176 + $this->addField('add_ons')
  177 + ->intro('A third party developer is willing to build an add-on for your framework. Can I put his add-on into a certain folder and then start using it right away?')
  178 + ->caption('Easily installable add-ons')
  179 + ->type('boolean')
  180 + ;
  181 +
  182 + $this->addField('add_on_extensions')
  183 + ->intro('Can add-on implement "soft-delete" and "audit-log" on some of your model?')
  184 + ->caption('Addons for models')
  185 + ->hint('If soft-delete is a built-in feature and could not be added through add-on esaily, don\'t click this')
  186 + ->type('boolean')
  187 + ;
  188 +
  189 + $this->addField('add_on_theme')
  190 + ->caption('Can add-on contain a new theme(s) for your UI elements?')
  191 + ->hint('Add-on must be able to supply HTML and CSS to standard UI of your framework. Do not tick if your framework has no UI')
  192 + ->type('boolean')
  193 + ;
  194 +
  195 + $this->addField('add_on_field')
  196 + ->intro('A third party developer wishes to build a new field type for a standard form. Is that doable through add-on?')
  197 + ->caption('Form field add-ons')
  198 + ->type('boolean')
  199 + ;
  200 +
  201 + $this->addField('add_on_global')
  202 + ->intro('A third party developer wants to build "debug toolbar" addon. It would sit below a regular screen and provide some additional info for your application. Would that be possible without having any preparations from the framework?')
  203 + ->caption('Application add-on')
  204 + ->type('boolean')
  205 + ;
  206 +
  207 + $this->addField('add_on_auth')
  208 + ->intro('A third party developer wants to implement add-on which adds "security code" to your standard log-in form. Is that possible to implement without replacing any of the auth functionality?')
  209 + ->caption('Authentication add-ons')
  210 + ->type('boolean')
  211 + ;
  212 +
  213 +
  214 + $this->addField('migration')
  215 + ->intro('Your applicaiton developed on top of the framework is being installed on 10 servers through versioning control system. Does framework offer a way how to distribute changes (migrations) without destructino of data?')
  216 + ->caption('Support for database migrations')
  217 + ->type('boolean')
  218 + ;
  219 +
  220 + $this->addField('simple_framework')
  221 + ->intro('When someone new to development considers if he should build web application from scratch or use your framework, would your framework be simpler and easier for him to use?')
  222 + ->caption('Simple Framework')
  223 + ->type('boolean')
  224 + ;
  225 +
  226 + $this->addField('nojs_application')
  227 + ->intro('Can a web application be built easily without any use of JavaScript?')
  228 + ->caption('no-javascript support')
  229 + ->type('boolean')
  230 + ;
  231 +
  232 + $this->addField('ajaxification')
  233 + ->intro('A developer have just finished his application which has very minimal JS use. He now wants to use AJAX to load page content when menu is clicked. Can framework facilitate that easily?')
  234 + ->caption('Ajaxification support')
  235 + ->type('boolean')
  236 + ;
  237 +
  238 + $this->addField('ajax_widget')
  239 + ->intro('A third party developer have created a widget which relies on some AJAX methods. Will this AJAX widget work anywhere in the applicaiton?')
  240 + ->caption('Universal AJAX')
  241 + ->hint('Do not tick if developer must know about the nature of the 3rd party add-on in order to make it working properly on a page')
  242 + ->type('boolean')
  243 + ;
  244 +
  245 + $this->addField('output_format')
  246 + ->intro('Assuming you have a page with a CRUD on it. You would like to turn on API which would produce result in other format (such as JSON) instead of HTML but would still offer same set of fields, records as the original CRUD. Is that possible in your framework?')
  247 + ->caption('Alternative output format')
  248 + ->type('boolean')
  249 + ;
  250 +
  251 + $this->addField('output_format_addon')
  252 + ->intro('Is it possible to add a new "action" to the API or introduce new output format through a simple add-on?')
  253 + ->caption('API addon')
  254 + ->hint('Do not tick if significant change to the application is necessary')
  255 + ->type('boolean')
  256 + ;
  257 +
  258 + $this->addField('dry_safe')
  259 + ->intro('Some framework will use code generation and even copy whole files to create CRUDs, which can be further modified by user thus violating Do not repeat yourself principle.')
  260 + ->caption('Is your framework DRY-safe?')
  261 + ->hint('Repetition of Language constructs is ok, but if blocks of statements is copied for user, then don\'t click')
  262 + ->type('boolean')
  263 + ;
  264 +
  265 + $this->addField('integration')
  266 + ->intro('Developer wishes to create command-line utility which can still use models, but wouldn\'t have any of the routing or any web-related functionality. Can framework facilitate that?')
  267 + ->caption('Support for command-line model use')
  268 + ->type('boolean')
  269 + ;
  270 +
  271 + $this->addField('integration_app')
  272 + ->intro('Existing software is built without use of a framework. Can your framework be integrated and can developer slowly start moving functionality onto your framework without breaking any existing code?')
  273 + ->caption('Migration to your framework')
  274 + ->type('boolean')
  275 + ;
  276 +
  277 + $this->addField('easy_upgrade')
  278 + ->intro('Two developers start working on identical projects. One of them is using previous version of your framework and other is using the most up-to-date version. After software is developed, the first developer notices that he have been using older version. He makes sure the applicaiton interface is compatible and upgrades framework to most recent version. Would both applications look exactly the same?')
  279 + ->caption('Framework clean upgrade')
  280 + ->hint('If your framework generates code, will it be able to "upgrade" all of the code it generated if necessary?')
  281 + ->type('boolean')
  282 + ;
  283 +
  284 + $this->addField('performance_sql')
  285 + ->intro('In pursuit to have minimal latency, developer tries to eliminate number of queries. He is not allowed to use cache. Will your framework permit developer to optimize and improve SQL queries?')
  286 + ->caption('SQL query optimization')
  287 + ->type('boolean')
  288 + ;
  289 +
  290 + $this->addField('performance_ui')
  291 + ->intro('The developer have found that your implementation of some component (ui component, logger, auth, routing) is ineffective. Can he globally substitute your implementaiton with his own? Will add-ons depending on replaced functionality continue to work un-changed and take advantage of new code?')
  292 + ->caption('Substitutions')
  293 + ->hint('Do not tick this if the only way to do this would be to replace actual classes inside a read-only framework distribution folder, which would be overwritten during upgrade')
  294 + ->type('boolean')
  295 + ;
  296 +
  297 + $this->addField('dev_and_designer')
  298 + ->intro('Your team consist of developer, but external designer is used. Will designer be able to deliver a skin for your framework which can then be used easily and consistently throughout interface by developer who has very little HTML skills?')
  299 + ->caption('HTML skinning')
  300 + ->type('boolean')
  301 + ;
  302 +
  303 + $this->addField('design_after')
  304 + ->intro('Your developer have finished work on the app. It is now necessary to change look and feel of the application. Will designer be able to change look and feel without going into business-logic my simply changing HTML templates?')
  305 + ->caption('Post-design')
  306 + ->type('boolean')
  307 + ;
  308 +
  309 + $this->addField('template_as_is')
  310 + ->intro('Designer have delivered a sample page HTML, which developer have to use. Developer integrates template into your framework. Now designer wants to do some more fixes to the template. Will he be able to find his HTML in a similar condition to how it was initially delivered?')
  311 + ->caption('Designer-friendly templates')
  312 + ->hint('Do not tick this if developer would typically distribute HTML across many small templates or would need to severely clean-up the HTML such as repetition of rows in a table')
  313 + ->type('boolean')
  314 + ;
  315 +
  316 + $this->addField('security_dev')
  317 + ->intro('Many developers have no understanding of data escaping and may never have heard about JS injection or cross-site scripting. When using your framework does your frameowrk employ some automated measures to protect application security even if developer is unaware?')
  318 + ->caption('Automatic security')
  319 + ->hint('Do not tick if developer must manually call encoding or verification functions on data')
  320 + ->type('boolean')
  321 + ;
  322 +
  323 +
  324 + }
  325 +
  326 +}
11 templates/default/page/compare.html
... ... @@ -0,0 +1,11 @@
  1 +<div id="<?$_name?>">
  2 +<h1>Good PHP Framework Comparison</h1>
  3 +
  4 +<p>Today many different web development platform compete to increase their developer user-base. How do they compare? Which framework gives me more? How do you get past the claims?</p>
  5 +
  6 +<p>From my part, I decided to build a comparison tool which could help to precisely measure Agile Toolkit with other frameworks and let developers from other frameworks to fill in the blanks.</p>
  7 +
  8 +<?$Content?>
  9 +
  10 +
  11 +</div>

0 comments on commit 610083d

Please sign in to comment.
Something went wrong with that request. Please try again.