Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
开发者_运维技巧 Improve this questionI've heard these terms used seemingly interchangeably, so I'm a little unclear. Please cite examples.
These terms, and others, do seem very similar. They're named from a conceptual standpoint, and so could be defined as follows:
- A "framework" is a "foundation" or "support structure" around which you build your actual application. The .NET Framework includes not only a foundation (the CLR) but a series of libraries that provide standardized functionality that you would otherwise have to implement yourself. Other frameworks or foundations provide more specific areas of support, such as in UI, data storage, client-server interaction, etc. Frameworks provide a relatively static, generic structure on and in which you build something specific and unique.
- An "engine" is a self-contained, but externally-controllable, piece of code that encapsulates powerful logic designed to perform a specific type of work. Engines exist to do "heavy lifting", where you instruct it to perform some complex, abstract task, and it handles the specifics in a relatively efficient manner without further external guidance. SQL implementations, and other services that perform searching, are typically called "engines". There are also physics engines, graphics engines, etc., which all have in common the idea that you tell it "do this" in some generic manner, and it handles the details.
A framework is something like a set of libraries that are meant to be able to work together. It's meant so you don't need to go around implementing common algorithms, and data structures. You use those libraries (the framework) to arrange them in a way so the functionality they provide helps you solve a problem.
An engine is a system, you feed it with data and it does it's job.
It's worth noting that a library can have an "engine" and an engine can be built using a framework.
A framework is mostly a bunch of component interfaces, but it does not implement those components. The framework does implement some glue code to help tie the framework together, and it provides some utility implementation for things that you’re likely to need.
A game engine implements all of the components defined in the framework… or at least all of the components that the game engine developer feels is required in order to implement his game engine. In some cases, an engine might not need physics or networking, etc, and so the game engine developer may choose to leave these components out of his engine.
Source: Frameworks vs Engines.
AFAIK a framework is the structure on which you build your applications. It differs from libraries in that it has inversion of control (i.e. in libraries, you call a subroutine from your code and so you have control; but in frameworks, you bind your subroutines to the framework and it calls your subroutine as and when needed - so the control is with the framework).
An engine is a totally different concept - it's a hybrid between a framework and a library. Like a framework, it has control over the application. However unlike a framework, you don't bind your subroutines to the engine but use its built in API to perform certain tasks (which is like a library).
In summary, a framework is the structure of the application which you can extend and tailor by binding your subroutines to it. OTOH, an engine is the main application itself which you can simply instruct to do what you want it to, using its public API.
Thus, frameworks are more flexible. However, an engine is a working application - so it gets the job done faster because the programmer doesn't need to waste time re-inventing the wheel. He can simply instruct the engine what to do and the engine will handle the internal operations.
An engine "does" the job for you.
A simple multiplication program.
A framework "simplifies" the job for you.
Instead of writing code for converting string to int and then presenting to engine, you have another code which converts it for you. This simplification code is a framework.
Framework examples:
- PureMVC (Flash)
- Spring (Java)
Engine examples:
- Gecko
- Google Search
A survey of different types of each gives a clue...
Engines
- Search engine, an information-retrieval system designed to find information on a computer system
- Game engine, the core software component of a computer or video game
- Layout engine, software that formats web content for display on a screen
- Rendering engine, software or hardware which converts specifications for images into pixels
- Ray-tracing engine, software which renders a scene by tracing simulated rays of light
- Polymorphic engine or mutation engine, an early conceptual or mechanical calculating device
- Difference engine, a mechanical calculator designed to tabulate polynomial functions
Analytical engine, a concept for a computer, designed by Charles Babbage
Frameworks
Artistic drawing, music composition, and mechanical CAD
- Compilers for different programming languages and target machines.
- Financial modeling applications
- Earth system modeling applications
- Decision support systems
- Media playback and authoring
- Web applications
- Middleware
精彩评论