Some understanding of the framework

    The framework is a complete process, a black box , which specifies the architecture of the application, and basically implements all aspects of the entire process, and links the processes together. What users have to do is to implement their own Business logic, and then through the predetermined steps, step by step, inject your own business logic into this process, and then start, the framework will execute your business logic. For example, hadoop, a complete mapreduce is actually very complex, which may include input->map->partition->sort->spill->mergereduce->output, but in general, users only need to write their own business logic, that is Map and reduce, because other links can use the default processing method, the framework has been provided. If the user does not want to use the default processing method, he can customize InputFormat, Partition, and OutFormat.

 

    A framework is a container .This container contains many components. The container manages the relationship between components and allocates and coordinates their previous work. For example, tomcat has Connector, Container, and Service. Users only need to inherit HTTPServlet or implement Servlet to customize a Service, register it in the container, and then provide HTTP services to the outside world. The container manages its entire life cycle.
    A framework is a collection of design patterns and conforms to principles such as Single Responsibility, Liskov Substitution, Interface Substitution, and the Open-Closed Principle. For example, tomcat makes extensive use of the chain of responsibility pattern. When a request comes, the container will pass it all the way to the servlet that finally handles the request. Tomcat, zookeeper, kafka, quartz all use the observer mode, that is, the event monitoring mechanism, also known as the publish-subscribe mode.
 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326469213&siteId=291194637