JWC - Rapid application development with FOF
Upcoming SlideShare
Loading in...5
×
 

JWC - Rapid application development with FOF

on

  • 1,878 views

My Framework on Framework presentation from the inaugural Joomla! World Conference

My Framework on Framework presentation from the inaugural Joomla! World Conference

Statistics

Views

Total Views
1,878
Views on SlideShare
1,877
Embed Views
1

Actions

Likes
1
Downloads
35
Comments
2

1 Embed 1

https://web.tweetdeck.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

JWC - Rapid application development with FOF JWC - Rapid application development with FOF Presentation Transcript

  • Rapid Application Developmentwith Framework on Framework (FOF)November 18th, 2012 – Joomla! World Conference
  • So, what is FOF anyway?November 18th, 2012 – Joomla! World Conference
  • I know what you’re thinking“Oh, no, not yet another framework!”November 18th, 2012 – Joomla! World Conference
  • FOF extends the Joomla! frameworkIt does not replace or undermine itNovember 18th, 2012 – Joomla! World Conference
  • DRY - Don’t Repeat YourselfI detest copying and pasting the same code, over and over and over and over and over and over and over...November 18th, 2012 – Joomla! World Conference
  • Less is moreConvention over configuration – less dev time, less code, less bugs, less maintenanceNovember 18th, 2012 – Joomla! World Conference
  • Doesn’t impose its way of thinkingNo black-box methods, multiple customizable triggers, plugin events, ...November 18th, 2012 – Joomla! World Conference
  • Plays along nicelyCompatible with Joomla! 1.5, 1.7, 2.5 and 3.0.November 18th, 2012 – Joomla! World Conference
  • Backwards compatibleNo sudden, quantum changes from one day to the nextNovember 18th, 2012 – Joomla! World Conference
  • Some historyHow it all came to beNovember 18th, 2012 – Joomla! World Conference
  • July 2009 – Base MVC classesCustom classes, extending JModel and friends, reducing copy & pasted codeNovember 18th, 2012 – Joomla! World Conference
  • September 2011 – Transformed into a frameworkBasically, I was pissed with another framework which kept on screwing me overNovember 18th, 2012 – Joomla! World Conference
  • Be the change you want to see!September 2011 – Transformed into a frameworkBasically, I was pissed with another framework which kept on screwing me overNovember 18th, 2012 – Joomla! World Conference
  • September 2012 – HMVCwhile stuck on the ground, inside a plane, for four freakin’ hours!November 18th, 2012 – Joomla! World Conference
  • May 2012 – Public releaseat the J and Beyond 2012 conferenceNovember 18th, 2012 – Joomla! World Conference
  • June 2012 – Bootstrap & jQueryIn optional Akeeba Strapper packageNovember 18th, 2012 – Joomla! World Conference
  • Being a FOF ComponentInside its mind, without visiting the 71/2 floor of a Manhattan office buildingNovember 18th, 2012 – Joomla! World Conference
  • AUDIENCEADVISORY BORING SLIDESNovember 18th, 2012 – Joomla! World Conference
  • Structure Dispatcher “triad” Controller Model View Table Helpers Toolbar
  • Structure Dispatcher The“triad” Dispatcher is the entry point (a.k.a. “router”). It will setup, Controller run and render the MVC triad. Model View Table Helpers Toolbar
  • Structure The Controller is a thin interface to push data to the model state Dispatcher and instantiate views “triad” Controller Model View Table Helpers Toolbar
  • Structure Dispatcher “triad” Controller Model View Table The Model is the workhorse. Business logic goes here. Helpers Toolbar
  • Structure Dispatcher “triad” Controller Model View Table The Table class is a hybrid data adapter, controller and model Helpers Toolbar (following J!s convention)
  • Structure Dispatcher “triad” Controller Model View Table The View fetches model state data and renders them in a meaningful way Helpers Toolbar
  • Structure Dispatcher “triad” Controller Model View The Toolbar handles Table rendering of titles, buttons and so on the Helpers Toolbar
  • Structure Dispatcher “triad” Controller Model View Non-OOP stuff.Table Basically, a nice way to say “cruft” Helpers Toolbar
  • Some general thoughts✤ Almost RESTful, but not quite✤ “Services first” approach. Built-in JSON and transparent authentication, opens the door to data provisioning for rich JS, Android, iOS etc apps✤ OAuth not supported (yet?). A custom, secure, TOTP-based transparent authentication scheme and HTTP Basic Authentication are supported, though.✤ We offer HMVC today. Actually, since October 2011.
  • Convention over Configuration
  • Convention over configuration inthe Dispatcher✤ The Dispatcher is your component’s router. It routes the request to the appropriate Controller based on conventions: ✤ A POST request gets routed to the save task ✤ A GET request to a plural view name gets routed to the browse task ✤ A front-end GET request with an ID gets routed to the read task ✤ A back-end GET request with an ID gets routed to the edit task
  • Convention over configuration inModels✤ Tables are named as #__component_view, e.g. #__todo_items✤ Auto increment field is named component_view_id, e.g. todo_item_id✤ Magic fields: enabled, created_by, created_on, modified_by, modified_on, locked_by, locked_on, hits✤ You can override defaults without copying & pasting code, ever. Copy & paste is the devil!
  • Convention over configuration inControllers✤ Default tasks (not RESTful!): browse, read, edit, add, delete, save, apply, ...✤ Customize with onBeforeMethod and onAfterMethod methods, e.g. onBeforeSave. Dont copy & paste code.✤ All MVC objects can be passed a $config array to customize them. It "flows" from dispatcher to component to model and view.✤ FOF guesses the task if its missing based on plural/singular view name and existence of ID in the query
  • Convention over configuration inViews✤ Views inherit from FOFView and its specialized children, e.g. FOFViewHtml✤ Customize using the onTask methods, e.g. onBrowse✤ The toolbar is handled outside the view, in a FOFToolbar descendant class. Override it with a toolbar.php file in the components root.✤ Magic toolbar methods, e.g. onItemsBrowse allow you to customize the toolbar without copying & pasting code.
  • Epic features
  • HMVC – Hierarchical MVC✤ Include the results of component views anywhere (other views, other component, modules, ...)✤ FOFDispatcher::getTmpInstance(‘com_foobar’, ‘items’, array(‘layout’ => ‘fancy’))->dispatch();
  • Reuse view templates✤ Load a view template from another view, component, ...✤ echo $this->loadAnyTemplate(site:com_foobar/item/form);
  • Language loading and overrides✤ Automatically loads component language files (frontend and backend)✤ Hierarchical language overriding ✤ English loads first ✤ Current site/user language loads next and overrides English
  • Media files overrides✤ Load media files like this: FOFTemplateUtils::addCSS(media://com_foobar/css/frontend.css);✤ Media overrides are inside the template folder, e.g. templates/tpl_example/media/com_foobar/css/frontend.css
  • Services first – automatic JSONand CSV views✤ Just add format=json or format=csv✤ JSON: You have an instant JSON-based remote API for your components✤ CSV: You can quickly export whatever you see in the backend to Excel, Numbers, LibreOffice, Google Docs, etc.✤ Transparent authentication support using URL parameters or HTTP Basic Authentication
  • A peek in my crystal ball
  • Are you pondering what I’mpondering?
  • Are you pondering what I’mpondering?✤ Input as an object, not as an array (yes, static methods suck)
  • Are you pondering what I’mpondering?✤ Input as an object, not as an array (yes, static methods suck)✤ Remove dependence on JModelLegacy and friends
  • Are you pondering what I’mpondering?✤ Input as an object, not as an array (yes, static methods suck)✤ Remove dependence on JModelLegacy and friends✤ FOFForm: (almost) no PHP and no HTML Joomla! extensions
  • Are you pondering what I’mpondering?✤ Input as an object, not as an array (yes, static methods suck)✤ Remove dependence on JModelLegacy and friends✤ FOFForm: (almost) no PHP and no HTML Joomla! extensions✤ Platform abstraction, allow use with JApplicationWeb and friends
  • Are you pondering what I’mpondering?✤ Input as an object, not as an array (yes, static methods suck)✤ Remove dependence on JModelLegacy and friends✤ FOFForm: (almost) no PHP and no HTML Joomla! extensions✤ Platform abstraction, allow use with JApplicationWeb and friends✤ RFC 2324 implementation (client)
  • Are you pondering what I’mpondering?✤ Input as an object, not as an array (yes, static methods suck)✤ Remove dependence on JModelLegacy and friends✤ FOFForm: (almost) no PHP and no HTML Joomla! extensions✤ Platform abstraction, allow use with JApplicationWeb and friends✤ RFC 2324 implementation (client)✤ A plan to take over the world!
  • Resources and communityhttp://akeeba.info/fof
  • CAN I HAZ SOME CODEZ?
  • Over and out.