Archive - Originally posted on "The Horse's Mouth" - 2010-05-21 17:44:34 - Graham Ellis
A web server access log file contains a whole series of hit records ... each of which is logically turned into an object as different fields have different characteristics. These hit objects can then be logically arranged into visit objects.
Today, I gave a Object Oriented Programming in PHP training course in which the practical application of OO techniques featured heavily (design, UML, patterns, etc). And during the afternoon, I took the web server log example and wrote a proof-of-concept demo from scratch - a "spike solution" through which we created very simple objects in hit and visit classes.
Have a look at the source code - [here] and you'll see a static factory method which creates the hit objects, the use of associated objects withing other objects, and much more.
The application could / should be extended. It's an OO framework in which a major log analysis resource could be developed. Not that I have much (any?) time for that - in fact I'm off for my 4th evening meeting in 5 evenings this week.