Skip to content
  • Home
  • Agro
    • Agro
    • Akuaponik
    • Hidroponik
    • Ayam Kampung
  • DIY
    • DIY
    • Rumah Kampung
  • Tech
    • Tech
    • Titanium Mobile
  • Media
    • Media
    • Downloads
    • Dashcam Drive
  • Misc
    • Pelbagai
    • Makanan
    • Fotografi
    • Idea
    • E-mau
  • Home
  • Agro
    • Agro
    • Akuaponik
    • Hidroponik
    • Ayam Kampung
  • DIY
    • DIY
    • Rumah Kampung
  • Tech
    • Tech
    • Titanium Mobile
  • Media
    • Media
    • Downloads
    • Dashcam Drive
  • Misc
    • Pelbagai
    • Makanan
    • Fotografi
    • Idea
    • E-mau
blog.azwan082.my


Blog ini tidak lagi dikemaskini, sila ke
👉 azwan082.my 👈
untuk dapatkan kandungan terbaru.

#Controller  #HMVC  #Idea  #MVC  #PHP

Page Controller Pt.2

On 26 August 2011 in Pelbagai

However, as the web application grow, the controller part may become very complex. As we know, a web page is a collection of sections which combined together to become a page – header, sidebar, main content, footer, banner etc. are sections (or whatever you call it). Therefore, it would be very complex when we need to include all this in a single controller. We can separate the smaller sections to another class or put it in our toolbox functions class, but it might be temporary before you may need it to act like a main controller. Here’s where the difference comes:

  • Most framework (that I know) only consist of single MVC, which designed to handle one simple request (CRUD operation of a blog post is a simple request)
  • A way to overcome this is by abstracting similar logics to a parent class, and let controller extends it. However not all conditions require those extra logics to be loaded for all requests.

Then I read http://techportal.ibuildings.com/2010/02/22/scaling-web-applications-with-hmvc/, an extension to ordinary MVC. It’s a collection of MVC triad that are independent to each other, and one MVC become the main controller. By using this idea, we can redesign our front controller to support HMVC and make it ready for a complex application

  1. Front controller received request, parse, delegate to target page controller as usual, and run the target controller.
  2. From within main controller, we may call another controller for different sections in that particular page.
  3. All sub controllers that being called from main controller will be independent of each other – make it look like requesting a different page. We may call it asynchronously (from within PHP, using cURL and get the response in whatever format)
  4. These subcontrollers doesn’t need to be reside in the same server or same script directory with the main controllers, it can be put in different server and act as a background service, interact using RPC, SOAP or other web service protocol

What’s more interesting is all these can be achieved without having to allocate too much resource as in term of development time (all can be done in PHP), server (one server can achieved all these) and maintainability (all components are structured and modularized – given you’re writing proper documentation and comments on the code). Take a look at Kohana or CodeIgniter if you’re interested to include this feature into your web application.

Share this post:
  • Share
  • Tweet
  • LinkedIn

Related posts:

  • PHP async request with auth
  • Singleton pattern
  • Singleton class
  • PHP Hooks System
  • Formula E bakal dianjurkan di Kuching?
  • Page Controller
  • Macam betul-betuuul
  • Cloudflare & phpBB3
  • phpBB SEO Ultimate URL backslash in URL
  • New PHP

Filed under Pelbagai with tags Controller, HMVC, Idea, MVC, PHP

Post navigation

Previous Post Previous post:
Page Controller
Next Post Next post:
Apache Caching Proxy Server

1 comment

  • Comment by Lagares 15 July 2014 at 3:41 pm - Reply

    Hello very nice blog! Person. Exceptional. Amazing. I’m going to save your web site in addition to consider the bottles furthermore? Now i am happy to uncover a lot of useful information listed here inside the organize, we end up needing build a lot more strategies during this respect, thanks for sharing.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Media sosial

  • facebook
  • instagram
  • twitter
  • pinterest
  • youtube

Carian

Artikel popular

  • Saiz standard kayu, papan dan plywood
  • Pemasangan dinding plywood rumah kampung secara solo
  • 3 Jenis Asas Sistem Hidroponik Yang Digunakan Dalam Akuaponik Serta Variasinya
  • Kepincangan dalam menggunakan paip PVC sebagai saluran NFT hidroponik
  • Cara membuat sistem NFT untuk akuaponik – Saliran masuk
  • Cara pasang pintu rumah
  • Jenis skru kayu
  • Slack MacOS client keep crashing

Artikel terkini

  • 2 video #emau dari 2020/0221 February 2020
  • Gaya hidup minimalis14 February 2020
  • How to sync Mac OS Photos Library to an external disk storage17 January 2020
  • Sejarah dividen KWSP10 January 2020
  • Sejarah dividen Tabung Haji10 January 2020
  • Sejarah dividen ASB10 January 2020
  • Selamat dekad baru 2020-an3 January 2020
  • Dashcam Drive #17 – Taman Danu Serian → Ranchan Recreational Park1 January 2020

Tag

1N2D Akuaponik Android Apache Ayam Kampung Bash C# Cache Cili CommonJS Controller Dashcam Drive E-mau Fedora Fotografi Git Gnome Happy Together Hidroponik Idea Invincible Youth iOS Java Javascript Ke Indonesia Ke Kita? Ke Jepun Ke Kita? Ke Korea Ke Kita? Kewangan ListView Makanan Mr. Bean PHP Python Rant Roundtable Plus RPM Rumah Kampung Star Golden Bell Subversion SVN Titanium Mobile Titanium Module Titanium Studio windows phone WrestleMania

Arkib

Perihal

@azwan082

Seorang pembangun perisian (software developer) untuk peranti mudah alih (mobile devices) dan laman web, menggunakan bahasa pengaturcaraan Swift (iOS), Java (Android), PHP, MySQL dan Javascript (aplikasi web). Blog ini adalah tempat untuk saya berkongsi perkara, minat dan projek sampingan, seperti berkebun, kerja² kayu DIY, video dashcam drive dan pelbagai lagi.

© 2021 Noodlecode

Back to top
sponsored