Geek Culture
Published in

Geek Culture

Framework vs Library

intrusive vs non-intrusive

What is difference between library and framework?

Quote:

The first major difference between a framework and a library is who is in control of the development process.

With a code library, a developer generally calls upon the library whenever they feel it is appropriate. A framework generally requires that the developer is fully immersed in its workflow.

As a result, it often feels as though the framework is in control of the development process rather than the developer. This is inversion of control! This is commonly simplified as some variation of the following:

* Library: Call us to get the job done.
* Framework:
You don’t call us, we’ll call you.

It is because of this inversion of control that frameworks are much more opinionated and also why they are capable of doing so much for developers.

Opinionated for those wondering means frameworks are making a lot of decisions regarding how code is written, the location of files, and possibly even the name of said files.

Making these assumptions allows for the usage of the paradigm of convention over configuration which allows developers to skip the process of app configuration in exchange for following certain conventions (such as putting certain files in certain folders, etc.).

https://betterprogramming.pub/libraries-vs-frameworks-whats-the-difference-5f28c53dcffe

Frameworks are further divided to intrusive and non-intrusive one. The main appeal of a non-intrusive framework is that it stays out of the way of your design and modelling activities. It stays completely out of the way until you need it. For example, Spring is non-intrusive framework. The application code doesn’t need to depend on any of the Spring objects directly. ORM framework are typically very intrusive.

My personal preference is the following: I prefer to use 1–2 non-intrusive frameworks in the project, such as Spring, Spring Boot, web.py in Python and many other libraries of the focused specific tasks. This is the reason why I don’t like popular Django and Flask frameworks in Python. On another side, I do use EJB3 in Java and it works reasonably well. But I’ve used it in non-typical manner — in order to use it efficiently I’ve read 300 page design document of it that allows me to know how can I customize it’s usage to very high (not-typical) degree. Another example will be JPA.

--

--

--

A new tech publication by Start it up (https://medium.com/swlh).

Recommended from Medium

The Journey to Our New Authentication System

What Are the Latest Mobile App Trends and How to Create an Application that Stands out?

those important questions need to be communicated to the doctors taking care of patients with COVID

Select in jsonb array example

CS371p Spring 2020: David Zhu-Eleventh Entry

Toast Notification Configurations

Budget Tracking Using Active Record & Ruby

Fix rbenv or ruby command not found after changing from bash to zsh

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
alex_ber

alex_ber

Senior Software Engineer at Pursway

More from Medium

NATS streaming server in Django

NoSQL, MongoDB, HiveQL

What Is Docker?

Apache Kafka CLI Commands Cheatsheet