Many of you may remember I had quite a time moving to PHP from vs.NET about a year ago. I have spent a good deal of time in study and have even asked a few questions here recently. Here's the story. I haven't worked professionally since just before the 9-11 incident. If you recall, the industry was suffering at that point and I lost my position due to cutbacks. Since the collapse and following events, I was evicted, lost my vehicles, had a son die (emotional effect), and other things to boot. Being self taught, and years out of practice, I find it impossible to get hired now. As a result, I want to start my own modest contracting agency but I was stuck between a rock and a hard place. I could not afford the newer Microsoft IDE's and really didn't want to learn another language. Well, I had to pick one, so I did. It's been a long road, but I think I've arrived. I haven't said much up until now because I didn't want to become discouraged at some point along the way. Just before the demise of my last official position, we were working on a distributed application for a major company. While I have no client to speak of at this point, I though that starting small, and working up to the point where I could duplicate that appliaction in PHP, would be a grand thing for me to do. Not only in a capacity for customization and sale, but for my own self esteem. Here is where I lay it on the line, to see if I have grapsed the concepts of a distributed PHP application. Be honest, but constructive in your replies.
----------
The basic application specs were:
- Database split into two. One hosues only raw data, the other userland settings.
* The reason for this is because there may be many UI's for the app and each needs to define it's own display settings and options.
- Modular service system. Modules may be placed on several servers.
* I selected web services for this need and build them around a common include file and a class repository so that the services could share classes internally while retaining the ability to expose only what's needed to the outside.
- Provide a client kit so that various web UI's can be built quickly.
* I selected simple customized SoapClient wrappers for this and a simple MVC design.
- Provide a service mapper so that a client app can be updated quickly to new service locations.
* I used a simple associative array here mapping service names with urls to wsdl files. This is tied into why I used SoapClient wrappers.
----------
So basically we now have an application that has both display and logic completely seperated at the code level, but in regards to the database as well. Each client UI may have it's own local database for language, phrases, templates, settings and options, while they all share the same content database.
----------
I made decent, but not overdone, use of singletons and patterns, as well some linear function code that just didn't need encapsulation. Even in a static class, it would've been overkill. Likewise, I used arrays where I could. They take less resources to instantiate. I make use of no globals, sanitize all input and output, and use inheritance where truly beneficial. Use of interfaces is slim as there wasn't much need. The skeleton app works like a charm, but I want to wait until I have a fully worked up example before I share the url. So shoot. Did I do a decent job based on the description?







Bookmarks