Lately I've been doing some restructuring on a site to improve performance and was wondering if there is any overhead involved when dynamically constructing a page from many smaller dynamic components using 'includes' as opposed to having all the code in the same page.

(For example, a product list page has the product summary component as an 'include' inside a loop).

There is overhead of course whenever you do an include. I usually stay away from doing includes in a loop. In such cases I tend to put the code in a library method. But if you don't expect many iterations of the loop, don't worry too much about the overhead.


I've been using the fusebox naming conventions and structuring the site as much as possible into fuseactions, circuits, fuses, display code and layout code

My current convention is to have three subfolders within each circuit: controller, model, and view. Business logic and non-DB actions go in controller, database access goes in model, and display code goes in view.


I thought that maybe Active 4D doesn't cache the included modules (say, the way it does libraries) and so it might be slower for the moment than a monolithic page where there are many iterations.

That is correct.


Also, what is the recommended way to pass properties set by a fuseaction to a display component ? (for example, the fuseaction . . . 'act_DoaQuery.a4d' . . . sets some properties and the display component 'dsp_showCatalog' wants to read these properties and modify it's own logic based on them. Is a collection the way to do this ? Where is best to initialise it ?

It depends on what the properties are. If the data comes from the DB, use a RowSet. If you have single properties, local variables are fine. If you have a lot of data of various types, a collection is the cleanest way.

Regards,

   Aparajita
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to