Reply to Re: How dynamic is too dynamic?

Your name:

Reply:


Posted by Good Man on 08/29/07 19:06

Adam Baker <adamb924@gmail.com> wrote in news:1188412863.944070.231590
@g4g2000hsf.googlegroups.com:

> This is a fairly broad question. I have looked for web sites or books
> on the topic, by to no avail.
>
> I'm creating a fairly small web site in which the content is drawn
> from an XML file (more or less as an exercise, but also so that it can
> be maintained easily).
>
> I've got a first-level page and five second-level pages.
>
> One way I'm trying it is to keep a single XML file, and two PHP files,
> one for the first level page and one for the second-level page. That
> makes pretty clunky content generation.
>
> The second option is to have a different PHP file for each second
> level page. Less elegant in one respect, but the individual PHP files
> are much simpler.
>
> This is a small example, but I'm curious whether people have
> experience with larger applications, and at what point they felt the
> PHP got intractable.
>
> Thanks for any thoughts,
> Adam

I'm a fan of clean seperation and order over perceived 'convenience' of
a single/a few PHP files.

One of the problems with rolling all your second-level pages into a
single PHP file is updating the file - if you make a code-error
somewhere (say, adding an enhancement to one section), 'all' of your
second-level pages will fail.

Secondly, once you come back to this project in six months or so, you
(or someone else, especially) will probably appreciate distinct pages
for each specific section as opposed to spending/wasting time poring
over the single PHP document and trying to figure out what's happening
where.

It is not uncommon for some programmers to have seperate files for each
class, and even for classes which extend other classes.

It's obviously a matter of personal preference, but as far as planning
for the future goes, I think seperation and order is a good thing.
Basic shared elements of your second-level can certainly utilize an
"include" file which makes basic updates as simple as if your pages were
all in one PHP file...

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация