Thursday, December 8, 2016

Visualforce - Beyond Basics Series 8 - Alternatives to MultiPage design

What is multipage design ?

visualforce is a multipage architectural design system which means that you need to design you application by building set of Pages aiming to use shared components & controller/extensions efficiently.

What is the problem with that design ?

Since, visualforce doesn't have a app specific namespace or a folder structure to isolate the application specific pages, it's difficult to maintain them in long term.


What is the solution ?

The solution is to keep the number of pages as less as possible, but still reusing components, controller/extension appropriately. This is in other words called Single Page Application(SPA).

How to do that ?

This is achieved through using 'SectionName' in the controller & displaying different sections in the pages, according the user navigation.


Where is the code ?

I have illustrated this technique using a Apex controller which will have the current section name. When the page navigates to the new section, it updates the section name in the controller & appropriate section gets rendered. By doing this, you avoid having different pages for different sections in the App.


1 comment:

Thanks for reading my blog !