From the course: .NET Fundamentals: Concepts, APIs, and Libraries in the .NET Framework

Terminology: Framework and library

- [Instructor] We choose a programming language for a project or for our company based on many factors. Those factors could include what type of project we're building. Years ago, web programmers picked JavaScript because it was a smart choice for front end web development, but it wasn't a good choice for server side development until more recently. People working in the data science and machine learning field like the Python language, iOS app developers mainly write code in the SWIFT or objective C languages. Another consideration is how robust is the ecosystem surrounding the programming language? Are there good libraries for connecting to data sources? How easy is it to find and use third-party or additional libraries to enhance your code base? Is the language backed by a strong partner or a company? Building an application on a system that disappears in a few years is bad news for you and your customers. All programming languages and their associated frameworks have pros and cons, strengths and weaknesses. Knowing these trade offs before choosing the language is a smart decision. It's good to get a big picture of the capabilities of any proposed system. On the other hand, if your team is already committed to a system and you are onboarding as a new member, it might be a good idea to take a step back and look at the broader view of what's available before digging into the low level coding stuff. That's what we're doing in this course, looking at the big picture. But before venturing into the .NET details, I think it's worth exploring some terminology employed in the software industry. In software development, these items listed here are some essential tools you'll leverage from your application code. They share plenty in common, and sometimes there is confusion about what is their purpose. At their core, these enable you to enhance the functionality of your application, with code provided by other developers. You may be familiar with this list, but I'm going to give you my definition so we have a common starting place. I'll define framework and library in this video, and SDK and API in the next. A library is a set of code functions bundled together. Add the library to your application, and you can call the functions within as needed. A math library, for example, provides access to common math operations like sine, and logarithmic functions. It provides constant values like pi. A data connection library provides code for working with various data sources. Libraries can come from many sources. They might be included with the programming language, they could be from a third party, or they could be custom libraries created by you or your team members. The definition of a framework has morphed over the decades. If you are familiar with modern web frameworks, you might expect .NET to be like those. Yes, there are some similarities, but .NET as a framework was based on an older concept, that is, a framework is a collection of code libraries. So let's look at some history. In the 1990s, Sun Microsystem created the Java programming language, and it included the Java collections framework. Really, this was just another name for a code library. But framework sounds interesting and important, doesn't it? C# was Microsoft's answer to Java. They decided to include the word framework too. The .NET framework was released at the same time as C#. To compete with Java, it contained a large and diverse set of libraries which is called the .NET base class libraries, or BCL. More recently, the idea of a framework has taken on new meaning. For some, it's like an application scaffolding. We build our application upon the framework, the framework is mostly a working application, we customize and extend it to make the application look and act the way we want. Often the framework will be calling code that we wrote. You might have heard the term inversion of control, or dependency inversion. Here's a quote from Martin Fowler that lays out this idea. He is an architect that has spent many years thinking about how to improve the software creation process. He said, "Inversion of control is a key part "of what makes a framework different to a library." He also said, "A library is essentially "a set of functions that you can call, "these days usually organized into classes." He further said that "A framework embodies "some abstract design, with more behavior built in. "In order to use it you need to insert your behavior "into various places in the framework... "The framework's code then calls your code at these points." Web frameworks are popular in the web development world. For example, they have three categories of frameworks, front end, back end, and CSS, or sometimes called user interface. In each of these categories, there is a huge selection of web frameworks to choose from. Now, many of these frameworks we're going to look at here are based on the idea that we just saw from Martin Fowler. In the web back end, we have frameworks like Django and Rails. Microsoft has one called ASP.NET Core. In the front end, we have Angular, React, Vue, and Ember. And for CSS frameworks, we've got Bootstrap, Tailwind, Bulma, and Materialize. Let's take one example from these. Ruby on Rails is a dynamic web application framework often used for quickly developing high-performing sites. GitHub is an example of an application built on Ruby on Rails. In this video we've seen my definition of the terms framework and library. To review, a library is a collection of pre-written code that can be used to perform specific tasks such as input output operations, or data manipulation. Libraries provide a set of functions that can be called by a developer to perform a specific task without the need to write the code themselves. A framework, at least a modern definition, is a collection of code and pre-built infrastructure that provides a set of conventions and a structure for building an application. Frameworks provide a higher level of abstraction and impose a certain architecture on the application, whereas libraries are typically more flexible, and can be used in a variety of ways. The .NET framework originated with framework as the simpler meaning, it's more in line with the library definition.

Contents