[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Class structures & templates (was Re: [Phpgroupware-developers] Filename

From: Brent Kelly
Subject: Class structures & templates (was Re: [Phpgroupware-developers] Filename Standards?)
Date: Tue, 05 Nov 2002 07:19:51 +1300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

Chris Weiss wrote:

Core apps tend to stick to the "ideal" standards, but for an app that's "just 
you" you can do whatever works.  Having that flexability is nice sometimes.  
For a
simple example check out the Notes app.

The basic idea is to have a 3-layered structure, Storage (so), Backoffice (bo), 
User Interface (ui).  Basically, the web based apps will call the UI functions, 
then UI will call the BO, which will then call the SO.  The SO will retrieve the
requested data and hand it back to the BO, which will do any processing needed 
as turning serialized data in to arrays and other such things then pass that 
to the UI class.  The UI then only does formating and makes use of the 
templates to
send the formated data to the browser.

Why split it up?  Well, you can now have your app provide a XML-RPC interface 
bypasses the UI layer and makes the BO call and hands that data back to the 
client, and maybe another method that simply accesses the SO call and returns 
raw data if your "thick client" app is more suited to do the BO type processing.
Or even make another UI class that makes full use of the same functions as the 
UI class except maybe provides a WAP interface instead of HTML. this way logic 
seperated from interface and storage.

With regard to these 'bo', 'so' and 'ui' classes, is it just me or does this seem a step in the opposite direction as far as the whole 'template' system goes? I may be completey wrong & what I talk about below may already exist - but if it does, I can't seem to figure it out ;).

I've been developing a custom template for phpgroupware and have found that for apps such as calander that use this system, adding/modifying templates can require extensive modification to the ui classes stored in the /inc directory of the application. Would it not make more sense to have these class files stored in the template directory of the app, or at least allow developers to have their own custom ui classes in their template directory of the application which, if a custom file exists, it would override its respective file in the inc directory? This would allow templates to be developed without requiring modifications to the initial code, allowing the same flexible template structure that existed with the old system.

Thanks in advance for anyone that can shed some light :)

Brent Kelly,
Zeald Ltd.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]