192 Chapter 5 Basic Web Application Strategies Traditional
194 Chapter 5 Basic Web Application Strategies PHP and COM The Component Object Model (COM ) is a software architecture developed by Microsoft that allows abstracting software chunks into binary components. COM defines a standard for component interoperability and specific features a component must have. It doesn t depend on any programming language; indeed, Microsoft shows efforts to establish COM as an open IETF (Internet Engineering Task Force) standard. COM objects can be accessed by any compliant application and programming language; for example,from Visual Basic,Delphi,or PHP. The question COM addresses is this: How can a system be designed in such a way that binary software components from different vendors can interoperate? Microsoft s first proposed answer to this question, the concept of DLLs, failed miserably. Because of the missing versioning in DLLs, no two DLLs exposing the same interface could be used on a single system. Let s make up an example. Say you ve got a server-monitoring application that continually checks whether a server is down and logs the collected data.You have a front end with pretty statistics and some logic to react in an appropriate way if the server is unreachable.The back end of the software could be a DLL performing the actual monitoring: Let s say that ServerSpy.dll exposes a function is_reachable(), taking a server name and returning true if the server is reachable or false if it s not. We haven t defined what kind of server to monitor yet indeed, it could be a Web server, mail server, name server, or any other system, and the function declaration itself as well as the back end wouldn t need to be changed.The only part needing a change would be the implementation of the function is_reachable(). With DLLs, you could have exactly one monitoring service on the system either Web server spy or mail server spy, etc. If you install another DLL, it would overwrite the previous one. Your application couldn t let the user choose between available monitoring services. Nor would it be possible to have a different version of one service available on the system. If another software vendor created a better implementation of ServerSpy.dll and sold that to your customer, it would again overwrite your version of the DLL. If the function worked exactly the same, all would be great otherwise, your application would stop working. A proper component model tries to solve these problems. COM provides a way to identify components through a globally unique ID (GUID), allowing you to use many services concurrently the operating system knows all installed components and your application could query it for components in the category Server Spy monitoring services. COM provides versioning, allowing you to have different versions of a component on the system without affecting each other. And finally, it provides component introspection, allowing you to see which methods and properties a component exposes. You probably have heard of ActiveX controls. ActiveX controls, also known as OLE controls or OCX because of Microsoft s creative marketing department, are simply an application of COM components.They provide a reduced set of COM interfaces so
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services