How long does it take to build a modern web framework?
Dear Java Web Framework Authors,
I hope you're doing well and continue to enjoy working on the web framework you created years ago. I'm curious to know something:
How long would it take you to build your web framework from scratch?
If all the code from your framework magically disappeared tomorrow and you had to write it from the ground up - how long would it take? What if you had a group of 3-5 developers (of your choosing) to help you do it?
Furthermore, would you write the whole thing line-by-line, or could you borrow code from other open source projects to streamline the process?
Thanks in advance for your response,
Matt
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)






Comments
Marcus Breese replied on Thu, 2008/01/24 - 4:29pm
I think the key issue implicit in your question is scope, and is something that many people will disagree on. There isn't much to the definition of a web framework, except that it must be able to accept a request and return a result back to the user. They also typically use Servlets or JEE to accomplish this task.
After that though, you'll have a lot of disagreement... do you mean a full MVC stack? Does the framework use an existing technology for the view aspects (JSP? Velocity?), or does it do something "special". From the perspective of the model, does the framework include an ActiveRecord type model itself, or does it just use Hibernate like the rest of the world?
So, to answer your question about my home-grown framework (Craptactulous as it is :) I can answer your question pretty easily... I did perform a major rewrite of it not too long ago. It is annotation based (so no XML configuration needed), doesn't rely on Spring (but can use it), uses JSP/JSTL for the view (I like to hand code HTML), and has no specific requirement for a model (but has a nice Hibernate support class). Basically, it's a reflection driven controller. the view is standard jsp, and the model is left up to the app author.
1 month at most, probably closer to 2 weeks.
I would probably rewrite it all from scratch without borrowing code from too many other places. I also like to limit the dependecies that are required. This does two things: 1) makes it easier to write without having to integrate extra code, and 2) makes things smaller... the smaller a framework, the less work it does, so the less you have to write... I tend to believe that the ess that a framework does, the better it can do that specific job and get out of my way of making the application.
Ignacio Coloma replied on Fri, 2008/01/25 - 3:07am
My case (loom): annotation-based, supports Spring, core taglib and ajax taglib, JSPs, etc. From scratch, it has been one year, six months working as a pet project and another six working mostly full-time. It would have required _much_more time if I had to coordinate with other people, and you are going to learn _a_helluva_lot_ in the process (one thing is to use a framework, and an entirely different one is to develop one).
I rely very little on third party libraries, and only when the quality of them has been well-proven. The parts that you will have to keep in mind are:
Having said that, if I understood the question be sure that the world really needs it. You more than anyone else know that there are plenty of web frameworks out there. You will also get it easier if you have real requirements (real people in need of your framework) as soon as possible. They make great beta testers :)