Web Frameworks: Why, how and when you should use them

There are a lot of articles talking about frameworks in almost every language out there. This time, I invite you to debate about something at a higher level: Why should you use a web framework?

A Common Problem

If you are a developer, chances are that you worked in a company in which there were lots of applications, each of them developed in a very different way.

Some of the potential problems you can find are the following:

  • Lots of duplicated code.
  • Every team develops their own in-house components in their own way: Configuration Management, Loggers, Database Access Layer, Caching Layer, etc.
  • Sometimes, as a consequence of the last point, there is very little –or a lack of- documentation.
  • Each application uses VERY different ways to implement the same thing: Web Services, GUI Applications, Daemons, etc.
  • Sometimes, in-house components have very little testingor no testing at all.
  • It’s very difficult to introduce a new developer to working on these applications due to all the problems discussed so far.

So, what can we do about it?

Let’s standardize!

There are a lot of different standards when we talk about development in general. Here, we specifically mean standardization about common things almost every web application needs:

  • Configuration
  • Loggers
  • Database Access
  • MVC
  • Caching
  • Etc

And the most important thing: How all these components are connected. This is often referred to as the glue code, which is the code that has the responsibility of loading and initializing an application’s components, and defines how a request will be handled. If no standard is defined in this regard, every developer will use their own ideas and best practices. As an inevitable consequence, you will have a lot of applications, each of them developed in a very different way, which causes serious problems in maintainability, testing, and learning curves for new developers.

Web Frameworks to the Rescue

A web framework provides you with a standard architecture for your applications. It should give you a closed (but customizable if needed) environment where common things are already solved using the best practices available. This way, developers can focus on the business problem they are requested to solve. They shouldn’t worry about how an MVC must be implemented, or how a configuration must be loaded. That’s the framework’s job.

Of course, there are a lot of web frameworks out there. So, which one should you choose? I’m not going to talk about specific frameworks. There are enough articles talking about that. Instead, I’m going to show you, in my opinion, which are the features a framework must provide in order to be a good choice:

  • It must use the best practicesavailable, and encourage you to use them too.
  • It should have a complete documentationabout its features, configuration parameters, requirements and usage examples.
  • It must be extensible. It should provide you with enough hooks so you can customize it should you need it.
  • It must provide you with a good base of tools from scratch, and a very rich list of third party components.
  • It should have a very strong and active community, with good supportand fast enough development cycles so you can obtain security patches and upgrades often.
  • It should be simple to use, maintain, testand deploy.
  • It MUST have a high test coverage
  • It MUST be secure.
  • It MUST have a good performance, or at least let you disable some features to obtain more
  • Its license should be compatible with your needs.

So, in a brief, a good framework should help you start from scratch without pain. It should offer you all the tools you need to solve your business problem, and give you all the confidence of well tested and maintained software, which is already being used in lots of professional applications. The advantages are really tempting:

  • No need to reinvent the wheel. Every developer now has a standard way of doing common things.
  • You already have a lot of documentationavailable, so new developers can join your team faster.
  • You have the confidence that a big part of your application is already tested, maintainedand used in production in a lot of applications.
  • You have a lot of functionality ready to be used. And if there is something you don’t have, chances are that another developer already worked on something similar, and you can reuse it.
  • You have a big and active communityready to back you up in the case you have questions about how the framework works.

Avoiding duplicated code and efforts, and having a standard that follows best practices in a development team is essential. A Web Framework should help you focus on your domain problem, ease the maintenance and testing of your application and help new developers join your team faster.


, , , , , ,
Previous Post
The Importance of Being Creative
Next Post
What is PEN?