What is the difference between a class library and a framework

后端 未结 11 1923
别那么骄傲
别那么骄傲 2020-12-01 13:04

I hear the whole day the terms class library, base class library, Framework, ...
What highlights a framework and what a base class library?

相关标签:
11条回答
  • 2020-12-01 13:27

    I think of a framework as a pattern that an application can conform to, defined in a set of libraries.

    A "base" class library might mean several things depending on the context; it could refer to classes that are designed to be derived from, which is a common approach in frameworks, or it could merely refer to a core library of classes that are assumed to be useful in any application and so are considered a "basic" need, almost part of the language (for example, container classes).

    0 讨论(0)
  • 2020-12-01 13:30

    A class library is simply a set of classes encapsulated into a definable unit such as an assembly. The term is not restricted to any particular language or framework.

    The Base Class Library (BCL) is a specific term attributes to the set of class libaries that come pre-installed with the .NET Framework which provide classes neatly organized into namespaces so that you have an API against which to build your own solutions.

    A framework is a wider term that is inclusive of the class libraries, a virtual machine that manages controlled execution of processes, provides a runtime environment, along with other services such as memory management and exception handling. See the .NET Framework for more information.

    0 讨论(0)
  • 2020-12-01 13:30

    A framework is an allegedly cohesive collection of one or more class libraries. The Java and .NET frameworks, for example are made up of hundreds of class libraries. In .NET there is, by custom but not necessarily, a correspondence between assemblies and class libraries. In Java there is a rough correspondence between namespaces and class libraries.

    Although I have never noticed the phrase "base class library", I would expect such a thing to contain abstract classes intended to be subclassed before use.

    Framework in the sense of my first paragraph implies completeness within the purview of the library. For example, you would expect an image manipulation framework to contain everything you need to manipulate images, ranging from file format parsers to in-memory graphics operations.

    0 讨论(0)
  • 2020-12-01 13:32

    An application has many parts coexisting in synchronization providing different functionality...now code must be written for each of these parts to work and therefore an Application Framework does that code for you so that you don't have to go through nitty-gritty of writing every code related to every functionality.Application frameworks make writing applications easier.

    In most simple terms if you are making a building then its skeleton structure,Shape,functions it can support,electrical and hydraulic design , frames,etc are all its framework and now you must work in that framework to make your building so all the worrying about making a earthquake proof structure or making a linearly erect building has been handled by your framework

    It's that simple. The framework takes all the complexities of interfacing with the operating system and simplifies them for you. It handles all the nitty-gritty details for you. Obviously certain frameworks do a better job at it than others.

    Difference between Application Framework and Libraries : You use a class library in writing your code, but you code within a framework.

    0 讨论(0)
  • 2020-12-01 13:34

    You use a class library in writing your code, but you code within a framework.

    The term "framework" is meant to invoke a sense of "being within an environment". If I were to put a (limited) analogy to it, I'd say that a class library is like being able to eat cheese and drink wine, whereas a framework is like visiting France; experiencing the culture. The framework is the structure around which you build your program. The class library are the tools you use (possibly within a framework).

    Of course, a framework will typically contain libraries of classes. .NET, for instance, has heaps of class libraries which are included in the entire framework.

    0 讨论(0)
提交回复
热议问题