Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a web framework as a learning experience

Tags:

frameworks

I would like to write my own (toy?) web framework as a learning experience. I want to go through the whole process from scratch. I'd like it to be served through Apache on Linux. I'm looking for the best route to understanding every step of what is happening when using a web framework. I'd like to use whatever language best facilitates this process. What is the best way for me to go about this? By "best" I mean "results in the deepest understanding of everything that happens in a modern web framework".

like image 798
Joe Cannatti Avatar asked Aug 26 '10 23:08

Joe Cannatti


People also ask

What is a web framework in simple terms?

A web framework is a software library that enables developers to write software that runs on the web. Common areas where developers use web frameworks are: Backend: The software that runs on servers and serves web sites, web apps, and also APIs for the exchange of data.

What makes a good web framework?

The best web framework for PHP development should have a Model – View – Controller pattern. The Model presents the data structure through an interface, the View visually represents the content on templates of web pages and output data, and the Controller controls user requests, database communication, and HTML view.

What is web framework and how it works?

A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and deploy web applications on the World Wide Web.


1 Answers

I am going to give a slightly tongue in cheek answer:

If I would start on this endeavour I would start with writing 3-5 web applications w/o framework support. Figure out what is always the same and factor that out. Refactor the applications to make use of it.

Then write some more web apps using your framework. Observe what you do over and over again. Factor that out and add it to your framework. Refactor the apps to see that your framework support works.

Repeat this and keep adding features till the framework becomes so large, complicated and unwieldy you just want to start over again. Then start over.

Now seriously, you are not going to learn how web frameworks work by writing a framework from scratch. You can only design frameworks when you have a pretty deep knowledge of the problem domain.

If you want to learn about what makes frameworks tick, do a couple of real projects in different frameworks/languages. See what works, feel what does not. Learn the design tradeoffs the framework developers have made. Try rails, jsf, seaside, lift, compojure, wicket, ... whatever.

Have fun and gain experience.

like image 95
Peter Tillemans Avatar answered Nov 23 '22 18:11

Peter Tillemans