473,757 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How dynamic is too dynamic?

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

Aug 29 '07 #1
3 1454
On Aug 29, 2:41 pm, Adam Baker <adamb...@gmail .comwrote:
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
Adam,

The fact that you are using an XML file really has little to do with
your question, that is just want your choosing for you persistent data
storage. Although your question doesn't seem to be worded about how
you are structuring your application based on the XML, in case you
are, just ask yourself if you would structure it the same if you were
using a database for storage. That's all it is, and it should be able
to be swapped out in the future if you so desire.

That gets to my next point. With the little information you gave
about your application, I don't think we can fairly judge and give
suggestions on how to structure your application...b ut I will try =).
If your "second-level" pages are all formatted the same (in a template
sense), you should have a single template file (presentation layer),
and one or more classes to actually do the business logic and data
manipulation. If the application is as small as you say, you can
probably get away with integrating the logic on how you want to
manipulate your data (control) in with the presentation layer...but
that is sketchy and depends on a lot of factors.

If this doesn't make too much sense, I apologize. If you post more
code, I can be more specific to your situation and probably
(hopefully) make more sense.

~steve

Aug 29 '07 #2
Good Man wrote:
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.
Of course, that's also its strength - because if you make a mistake, you
only have to fix it one file.
Aug 29 '07 #3
On Aug 29, 12:05 pm, ELINTPimp <smsi...@gmail. comwrote:
On Aug 29, 2:41 pm, Adam Baker <adamb...@gmail .comwrote:
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

Adam,

The fact that you are using an XML file really has little to do with
your question, that is just want your choosing for you persistent data
storage. Although your question doesn't seem to be worded about how
you are structuring your application based on the XML, in case you
are, just ask yourself if you would structure it the same if you were
using a database for storage. That's all it is, and it should be able
to be swapped out in the future if you so desire.

That gets to my next point. With the little information you gave
about your application, I don't think we can fairly judge and give
suggestions on how to structure your application...b ut I will try =).
If your "second-level" pages are all formatted the same (in a template
sense), you should have a single template file (presentation layer),
and one or more classes to actually do the business logic and data
manipulation. If the application is as small as you say, you can
probably get away with integrating the logic on how you want to
manipulate your data (control) in with the presentation layer...but
that is sketchy and depends on a lot of factors.

If this doesn't make too much sense, I apologize. If you post more
code, I can be more specific to your situation and probably
(hopefully) make more sense.

~steve
Thanks for your thoughts, Steve. I am less interested in doing my
current project "correctly" than in general principles of organizing
large web sites. Here is the web site if you are interested (I'm
continuing to work on it, so if you visit when something is not
working properly, I apologize):

http://www.u.arizona.edu/~tabaker/apil/

It's just a web site for a lab. The content associated with the middle
three buttons is all fluid, so it makes sense to generate the pages
dynamically.

To offer a specific example of a question I had, I've got one version
where the location and color associated with each button was read from
the XML file. Theoretically that makes modifications easier, and I
could add a new section later on if I want to. But, the programming
gets really clunky. And it's hard to think of a situation where I'd
need to make such a drastic change.

Intuitively it seems like a bad idea to have user interface stuff
controlled in the same database that the content comes from. But in
any but the most trivial graphical interface, the design depends on
the content. But if the interface depends so heavily on the content,
and to change the content would require a change to the interface, why
am I bothering to generate the pages dynamically?

Those are the specifics, but as I say, I'm less interested in this
particular project than I am in general principles.

Adam

Aug 29 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1891
by: Roel Wuyts | last post by:
CALL FOR CONTRIBUTIONS International Workshop on Revival of Dynamic Languages http://pico.vub.ac.be/~wdmeuter/RDL04/index.html (at OOPSLA2004, Vancouver, British Columbia, Canada, October 24-28, 200) Organization committee: Roel Wuyts (primary contact - roel.wuyts@ulb.ac.be), Gilad Bracha, Wolfgang De Meuter, Stéphane Ducasse and Oscar Nierstrasz.
1
2390
by: Guinness Mann | last post by:
When you guys talk about "dynamic SQL," to what exactly are you referring? Is dynamic SQL anything that isn't a stored procedure? Specifically, I use ASP.NET to communicate with my SQL Server 2000, using an SqlConnection object to open the database and an SqlCommand object to transfer my SQL text to the database. Is this the "dynamic SQL" that is such a bad thing? What is my alternative? Wait until after my program is working and...
6
2980
by: Materialised | last post by:
Hi Everyone, I apologise if this is covered in the FAQ, I did look, but nothing actually stood out to me as being relative to my subject. I want to create a 2 dimensional array, a 'array of strings'. I already know that no individual string will be longer than 50 characters. I just don't know before run time how many elements of the array will be needed. I have heard it is possible to dynamically allocate memory for a 2
3
1312
by: Stephen Gennard | last post by:
Hello, I having a problem dynamically invoking a static method that takes a reference to a SByte*. If I do it directly it works just fine. Anyone any ideas why? I have include a example below... --
7
3391
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always either AND or OR but never mixed together. We can use Northwind database for my question, it is very similar to the structure of the problem on the database I am working on. IF(SELECT OBJECT_ID('REPORT')) IS NOT NULL DROP TABLE REPORT_SELECTION
0
2073
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab, System and Software Engineering Lab), ULB (deComp) and the Belgian Association for Dynamic Languages (BADL) are very pleased to invite you to a whole day of presentations about the programming languages Self, Smalltalk and Common Lisp by experts in...
7
22495
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We added an entry to the executable's .exe.config file to specify the URL, and under the 1.1 framework this worked well. Unfortunately, this is not working under the 2.0 framework. I see in the Reference.cs file under the web service reference the...
1
7976
by: Peterwkc | last post by:
Hello all expert, i have two program which make me desperate bu after i have noticed the forum, my future is become brightness back. By the way, my problem is like this i the first program was compiled and run without any erros but the second program has a run time error when the function return from allocate and the ptr become NULL. How to fixed this? Second Program: /* Best Method to allocate memory for 2D Array because it's ...
5
2585
by: bearophileHUGS | last post by:
I often use Python to write small programs, in the range of 50-500 lines of code. For example to process some bioinformatics data, perform some data munging, to apply a randomized optimization algorithm to solve a certain messy problem, and many different things. For that I often use several general modules that I have written, like implementation of certain data structures, and small general "utility" functions/classes, plus of course...
0
9487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10069
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9735
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.