views:

66

answers:

3

Hi. I'm building a sort of web framework I guess.. It started with a simple website I wrote in php. I decided not to use any framework out there, because I wanted to learn how to do things on my own and it was never supposed to be any fancy website anyways... Now I suddenly need a lot of "modules" I previously have used from frameworks out there. Instead of using modules from a framework, I thought maybe to write them my self to really understand what's going on...

Any books and tutorials on actually writing your own "modules" for:

  • user authentication
  • page caching and templating
  • form validating and handling
  • database integration
  • mvc and cms

Most books on these topics just talk about it and refers to a framework out there. I'm looking for guidance to write actual code :P

Language is not important, but php, python, ruby, or java is preferred.

Thanks

+2  A: 

I've been through exactly the same thought pattern as you. I remember trying to build my own forum software in ASP 3.0 about 10 years ago, all for the purpose of understanding the entire process rather than implementing someone else's work.

Personally, I started with PHP and MySql Web Development (now in it's 4th edition). I found it practical and read it cover to cover.

I also think you should read a book on Object Oriented Programming and the Model View Controller (MVC) style of framework design. I learned all I know about OOP and MVC through Ruby on Rails. If you're interested in branching out past PHP to learn MVC and OOP in a practical sense, read Agile Web Development with Ruby on Rails (3rd Edition)

Finally, play with some other frameworks and see how they do things before rolling your own. Code Igniter, WordPress, Joomla, Cake PHP are all great systems built by communities that have the same mind set you do.

Hope that helps!

Jessedc
+2  A: 
Hassan Syed
+2  A: 

Building a web framework, you're going to come across many architectural choices that have to be made. A good framework relies heavily on design patterns. If you haven't read it already, read Design Patterns and think about how those patterns will shape the overall structure of the code.

Books can give you a general idea of what direction to take, but these problems have already been solved by any number of other web frameworks. Studying the source code of Django, Rails and a PHP framework like Zend will give you a much clearer idea of how the issues that you mention have already been solved and what might work best for your framework.

Zach Bialecki
+1 on the GOF book :P
Hassan Syed