Cheap Web Hosting for Developers

PHP, MySQL, Java, Unix Cheap Web Hosting

108 Chapter 3 Application Design: A Real-Life Example

Filed under: Web Applications Development With PHP4.0 — webmaster @ 06:09

Interfacing the Network 109 This is exactly what we want: the ability to store a Boolean value in a place in memory where every process can look at it. Since shared memory works (as the name suggests) only in RAM,it s extremely fast and requires almost no overhead.With this option, every chat process looks for its own variable in shared memory and only issues a query to the database whenever it finds that variable set by the user-input field. Why is the data exchange still based on a database at the very end? Try to find some answers. The database is still being used for one main reason. Shared memory is not supported by default in PHP; you need to specifically compile support for it into PHP. However, many people with access to a PHP-enabled server don t have the option of recompiling PHP because they only rented space on the server, because they don t have sufficient rights, or maybe because others depend on a certain setup of PHP. Leaving the database in as the final data-exchange path makes use of shared memory as an optional optimization. People who can t use it can simply disable it and still have a fully working version of the chat server operating at suboptimal performance, but operating. When creating an application designed for widespread distribution, keep in mind that not everyone will have the same setup as you and probably not the possibility of re-creating your very special setup. Even though PHP is 99% system-independent, some things do depend on the system. Carefully calculate whether enforcing certain circumstances is worth a potentially huge loss of customers. Interface to the User Now that we moved all the tricky parts with the data exchange out of the way, the actual HTML interface to the user is trivial.We know how to accept input from the user and how to deal with network communication.The last problem is packaging the generated output for the user in a convenient way. HTML offers only one way to have different windows act independently in one browser view:framesets.The interface typically consists of the user-input field; the chat output field; a nickname list (or just nick list), which shows other participating clients in the same room; and an action panel to allow one-click control over the chat for actions such as nickname changes,joins,parts,quits,and so on.These activities can all be handled by single processes whose output will be integrated into a frameset.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services

10 Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Cheap Web Hosting