Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 200002

Re: [PHP3] scalable design, content separation and modules From: Chris (cmayes3 <email protected>)
Date: 02/20/00

On Sun, Feb 20, 2000 at 01:10:33AM +0000, Aidan Skinner wrote:
> > functions. After reading Medinets's PHP book, I decided to redesign the
> > site using as much modularization and abstraction as possible. My first
>
> Too much abstraction can be as difficult as too little. Be careful
> when things start to get hairy, it generally means You've Done
> Something Wrong.
>
That's a good point. I have been considering using XML-RPC to abstract
content from the application's logic (while also providing a
language-neutral interface for networked applications). Do you think that
this would be going a bit overboard as far as abstraction goes? My original
plan was to make XML-RPC interfaces for modules while calling said modules
directly for the local application. Later, I ran across Giancarlo's (greets
to him if he's subscribed) Phplib mods which would allow authentication over
XML-RPC. A couple questions on that: would it slow things down too much to
use the XML-RPC interface exclusively for content interaction (even the
local app)? Would it be possible/practical to authenticate and maintain a session
with Phplib over XML-RPC using a non-web-based client written in, for instance,
Perl? Would an XML-RPC interface to the auth module be a significant security risk?

> > books on the subject of software design (Design Patterns, Practice of
> > Programming, Pragmatic Programmer) to try to remedy my deficiency. However,
>
> I would *strongly* reccomend the design patterns book (assuming it's
> the one by Gamma et al). It's *excellent*.
>
Yep, that's the one. It looks like one of the books in my order is out of
stock, so it may be a while before the books arrive...

> > a tough time with logic/layout separation. I've looked at templates, but I
>
> HTML 4.0 Strict, CSS1. It's truly and utterly wonderful.
>
I usually half-ass this portion of the design. Broken CSS implementations
on different browsers tend to mangle whatever I try to define. 'Course,
it's been a while (2-3 years) since I've written a significantly large website on my
own. I'll give this portion of my design more thought this time around :-)

I'd still like to be able to get the layout and the logic of the app
separated, though. Writing out the HTML from within the logic modules seems like a
somewhat hackish way to go about writing a scalable site, especially if
non-programmers would need to maintain parts of the site. Any suggestions
for this?

>
> BTW, how does one get around the problem caused by module 1 including
> or requiring modules 2 and 3, and module 2 including or requiring module 3?
>
> (specifically, all classes etc being defined twice or more)
>
Well, my current design makes module inclusion relatively straightforward.
It's a webbox layout (which is based on ColdFusion's FuseBox layout (see Bill
Holloway's description here: http://phpbuilder.com/columns/bill19990831.php3),
which means that each portion of a site has an index page where a big switch
statement evaluates request headers and calls various module methods based on that.
So, I just include() the module files in the index page.

Oh, well. I'm still debating on how much I should use XML-RPC in the
site... Since I'm not very far at all into the project, it probably won't
hurt to at least give full-on content abstraction a try. Let me know what
you all think.

Thanks,

-Chris

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>