What are dependencies in a framework for?

Asked

Viewed 105 times

2

I’m completely new to this framework issue and I can’t find any answer on google about this question.

What are dependencies and what are they for? What do they do?

2 answers

3

Dependency is a generic term indicating that the framework needs one or more libraries (classes or other artifacts) specified to function properly.

For example, jquery plugins usually depend on the jquery itself being 'installed' in the project without it the plugin would not work.

Several languages have some tools that facilitate the installation and manipulation of these libraries that are known as dependency managers. Some tasks that managers offer are, searching libraries, donwload, installation and dealing with dependencies, this means that libraries will be installed in the version compatible with the framework used in the project. Some examples of these tools are, Composer, Maven and more Enerica the linux package managers.

  • man, thank you so much. now yes I get it. great answer

2

I think this is a case where an image can be worth a thousand words. This is a basic map of the dependencies of framework Nyan:

inserir a descrição da imagem aqui

This framework proposes to offer a framework capable of exposing a Restful API based on ORM-style data storage.

Realize that the framework itself is just a coordinator - it doesn’t know how to expose REST interfaces or access data.

These actions occur in dependencies, which are the real agents in their respective domains. A typical REST call would then be a feature orchestration by the framework:

GET /data/users/256

  • Microsoft Webapi 2.0 receives the requisition, and the transfer to the framework;
  • The framework maps the request to a previously defined ORM class, Users;
  • Stackexchange Redis checks whether the data is cached or not; if negative,
  • Stackexchange Dapper generates a request to the database;
  • The database client (Mysql, Oracle or SQL Server, for example) sends the request to the server;
  • The framework then:
    • serializes the result via Netwonsoft JSON
    • Stores serialized content in Redis
    • Uses Netmq to notify other servers of the update
  • Microsoft Webapi 2.0 returns the serialized result for the client.

Note then that the above action triggered 7 dependencies.

In a simplified way, the dependencies are modules that know how to deal with specific implementation aspects; and frameworks are orchestrators of flows and functionalities.

  • 1

    This turned out good and explains cool. I was almost to answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.