Difference between frame and container?

I read this question on SO: Framework vs. Toolkit vs. Library where the difference between the framework and the library is explained. The general opinion is that the main difference is inversion of control, so you have hot spots in the framework where you attach your application functionality (in fact, you choose between inheritance / template / heavyweight or composition / strategy / easy to achieve of this).

OK, now I'm curious, what's the difference between a frame and a container? I saw the following container definition (Rod Johnson): "A container is an environment in which application code / objects work." And it confused me. I thought this was more or less the definition of any framework :) I mean, if you use the IoC parameter as a parameter that makes the difference between the library and the framework (otherwise you call the library, but the framework calls you), doesn’t that mean What more or less does any structure satisfy the definition of a container?

Thanks in advance.

+1
definition frameworks containers
Sep 05 '11 at 15:52
source share
1 answer

I think you are mixing the principle of inverse control and the IoC tool.

The main characteristic of the structure is that it follows the IoC principle and calls your code (as explained in the linked thread). An IoC container is just a tool, not a full-blown structure that helps you write cohesive, loosely coupled code following the IoC principle.

In general (at least in .Net), the Container class lies at the heart of this tool, where the registration / resolution / plotting of an object, etc. takes place, but I believe that this name is a historical artifact based on the name PicoContainer and Martin Fowlers. Inversion of control containers and dependency injection pattern .

+1
Sep 06 2018-11-11T00
source share



All Articles