Content Management System Design / Plugin Implementation
Posted: Wed Oct 01, 2003 10:48 pm
I would like to write a simple, clean and object oriented content management system that will make use of a plug-in system. In the past I had written applications in PHP with a terrible implementation of object oriented design. Instead of treating certain entities as objects I would just gather related functions within classes. I used this poor design in a c.m.s. I wrote several years back, times have changed.
Since I have spent much time studying and applying object oriented methodology and would like to make another attempt. I have browsed and reviewed the Movable Type source and find its object oriented base extraordinarily inspirational. The application itself is based on a low-level object, MT. MT's subclass, App, handles most of the user authentication, browser-related details and other important functionality. CMS, the final subclass of MT and App provides the final link to the user containing functions related to the backend itself and other important features.
The data storage device is also similar. Each Entry, Comment and Trackback is a subclass of Object which makes use of specific Drivers objects. The Drivers are written to handle the data storage. The developer could program drivers for MySQL, DBM, XML or just flat-files while the application just implements a standard API. The Object subclasses are able to load themselves, save themselves and do other important storage functions.
The last aspect of Movable Type which I love is the manner in which plugging are used. Developers could write this plug-ins, following certain rules and API's, and place them in a directory that the application browses. Upon the realization of a plug-in it is loaded into the application and hooked into the templating system. It's a well thought out design.
Now, the problem is how could I implement a design like this in a c.m.s. written in PHP? The object oriented design itself isn't too hard to implement. However, the plug-in system is somewhat more difficult to implement. How could the application incorporate this plug-ins into its own code base? Where could I hook this plug-ins into the code of the application? I would love to create plug-ins that has tremendous power and solid access to the application. It would be ideal to be able to write an XML-RPC plug-in that provides a remote interface for external clients.
I need some ideas, comments, code examples. I haven't written a PHP application in some time. In the recent months I have been concentrating on OS X development with Cocoa and Objective-C. I had come up with the idea for plug-ins after working with Objective-C and Cocoa for some time and would like to make use of this practice with a PHP application. I would like to thank those who took the time to read this.
Since I have spent much time studying and applying object oriented methodology and would like to make another attempt. I have browsed and reviewed the Movable Type source and find its object oriented base extraordinarily inspirational. The application itself is based on a low-level object, MT. MT's subclass, App, handles most of the user authentication, browser-related details and other important functionality. CMS, the final subclass of MT and App provides the final link to the user containing functions related to the backend itself and other important features.
The data storage device is also similar. Each Entry, Comment and Trackback is a subclass of Object which makes use of specific Drivers objects. The Drivers are written to handle the data storage. The developer could program drivers for MySQL, DBM, XML or just flat-files while the application just implements a standard API. The Object subclasses are able to load themselves, save themselves and do other important storage functions.
The last aspect of Movable Type which I love is the manner in which plugging are used. Developers could write this plug-ins, following certain rules and API's, and place them in a directory that the application browses. Upon the realization of a plug-in it is loaded into the application and hooked into the templating system. It's a well thought out design.
Now, the problem is how could I implement a design like this in a c.m.s. written in PHP? The object oriented design itself isn't too hard to implement. However, the plug-in system is somewhat more difficult to implement. How could the application incorporate this plug-ins into its own code base? Where could I hook this plug-ins into the code of the application? I would love to create plug-ins that has tremendous power and solid access to the application. It would be ideal to be able to write an XML-RPC plug-in that provides a remote interface for external clients.
I need some ideas, comments, code examples. I haven't written a PHP application in some time. In the recent months I have been concentrating on OS X development with Cocoa and Objective-C. I had come up with the idea for plug-ins after working with Objective-C and Cocoa for some time and would like to make use of this practice with a PHP application. I would like to thank those who took the time to read this.