Even if you only build websites using CMSs, you've probably heard the word "framework" before.
You've probably also heard of a few famous web frameworks, including Ruby on Rails, Django and Bootstrap.
Many experienced web developers build websites using frameworks and often find them easier and enjoyable to use.
In this tutorial, we're going to explain what a framework is, and when you might use a framework.
If you are currently doing one of the OSTraining Coding classes, this information will prove especially useful to you.
If you are just using a CMS, this post will still contain some valuable insights, as many CMS systems can and are built using frameworks. For example, Drupal 8 is currently being built on Symfony and Joomla 3 is using the CSS framework Bootstrap.
The goal of a framework is to allow designers and developers to focus on building the unique features for their project, rather than re-inventing the wheel by coding common, familiar features found across many websites and web applications.
A framework can be considered a pre-built template/structure that handles most of the repetitive or common features. As a result, unlike a CMS, a framework will probably not have a user interface (although this is not always the case, as Django provides an administration interface). Most of the activity will be done by writing code and interacting with different parts of the framework itself through code.
Often frameworks take a while to learn, but once you're familiar with them, they should speed up your development time.
1. The level of customization you require: A good way to explain this would be to use an example. Say that you are running a company called Company AA with around 40 employees. You recently read a study that indicated how social interaction both in the workplace and online can drive innovation in your company. You want to employ this idea but you feel that using a public tool like Facebook or Twitter cannot address the solution of having a private and custom social network among your employees. You have also evaluated 'plugins' available for your CMS, but none of them quite fit the desired layout and interaction you'd like from your social tool (without a lot of hacking to get it to work). You therefore consider getting a custom development done for this project. As you can see, the above example indicates that the greater the level of customization, the more likely you would be using a framework. However, this also depends on point 2:
2. The developers you employ: If you aren't going to do the development yourself, you will likely want to employ a team of developers (or a freelancer - depending on the size of the project) to do the work for you. Although a lot of developers do use open-source and freely available frameworks, some prefer to use their own custom-built internal frameworks and some choose to not use frameworks at all. Just like most communities that voice their opinions, the programmer community does so on many aspects, including the actual language used, the design pattern, the way the code is written and of course, multiple aspects concerning using frameworks. The choice developers make in whether or not to use a framework leads us to the next part of this blog, which is concerning the pros and cons of using a development tool like a framework.
A framework is not absolutely necessary: it is “just” one of the tools that is available to help you develop better and faster!
Better, because a framework provides you with the certainty that you are developing an application that is in full compliance with the business rules, that is structured, and that is both maintainable and upgradable.
Faster, because it allows developers to save time by re-using generic modules in order to focus on other areas. Without, however, ever being tied to the framework itself.
This is the basic principle of a framework: Not having to reinvent the wheel. And doing away with foreboding, low value added tasks (for example, the development of generic components) in order to fully focus on the business rules.
As an example, a framework will keep the developer from having to spend 2 or 3 days creating an authentication form (which is not a specific task). The time that is saved can be dedicated to more specific components as well as to the corresponding unit tests; giving you solid, sustainable and high quality code.