[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slightly OT: Programming with Modules



Mark-

Building a fully functional extension mechanism that is also very clean 
is kind of a holy grail.  The more functionality you expose to a third 
party, the more complicated (and normally abstracted) your framework 
gets.  This is probably why you can't easily sit down and chase a design 
by tracking code from somewhere in the middle of it.

There are lots of different ways folks go about building out a 
framework, and, to me, many of them are not well designed at first and 
eventually paint themselves into a corner, where at some point, they 
face the inevitable refactoring (or complete redesign) situation (e.g., 
V2.0).  This is not easy to do, probably the reason you see hundreds of 
different framework projects.

A lot of the design possibilities are dependent upon the language used, 
which is one reason there are so many approaches.  C programmers often 
declare some functions, require you to build your own with the same 
parameters, register them, and then their code will call them.  MS COM 
objects provide a binary interface contract that is not truly object 
oriented (OO), so you see all sorts of gyrations in that realm.  Java 
and other languages design true OO interfaces that you are required to 
implement.  Java can use things like reflection to include your code.

The bottom line, I suppose is that all the good designs derive from 
using interfaces so that the host application/framework doesn't have to 
know /understand the implementation (decoupled).  I suppose, to 
understand all this, I would recommend you study object-oriented 
programming (using Java, PHP5, Python, or Ruby), Design Patterns 
(Gamma), Refactoring (Fowler), and a well designed framework (Eclipse).

If this is too much right now, and you just want to test some PHP 
options, you could look into the Zend Framework, CakePHP, or Qcodo.

http://framework.zend.com/
http://www.cakephp.org/
http://qcodo.com/

Good luck,

Chuck


Mark Thurman wrote:
> I'm a young programmer (just finishing high school) who has done a fair
> amount of programming with PHP, MySQL, and other web technologies.
> However, being self trained, I was wondering if the members could help
> me with some questions.  I am looking at projects such as PHPNuke,
> Wikipedia, phpBB2, etc and they all have modules, extensions etc.  
> 
> How does one go about designing a program so it can be extended later
> with plugins, apis, and modules?
> 
> For example, in Wikipedia, to add a "Special" page, you include that
> page's source code in the main file, and then voila, it appears in
> lists, links, and adds its own functions and links to the code?  How
> does one think and design a program so that functionality is possible?
> 
> I've tried reading source code from some of these projects and I never
> can just follow along myself.  Therefore, if anyone has some simple code
> they'd be willing to share, links to only books or howtos, or just
> personal experiences, please reply on or off list.  If I haven't made
> myself clear, please ask for clarification.
> 
> Thanks for your help,
> Mark
> 
> 
> -
> To unsubscribe, send email to majordomo@silug.org with
> "unsubscribe silug-discuss" in the body.


-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.