phpgroupware-developers
[Top][All Lists]
Advanced

[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 
for
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), 
and
User Interface (ui).  Basically, the web based apps will call the UI functions, 
and
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 
such
as turning serialized data in to arrays and other such things then pass that 
back
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 
that
bypasses the UI layer and makes the BO call and hands that data back to the 
XML-RPC
client, and maybe another method that simply accesses the SO call and returns 
the
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 
main
UI class except maybe provides a WAP interface instead of HTML. this way logic 
is
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]