Framework:
What is 1: A framework is a set of specifications. Since it is a specification, when you use this framework, you must abide by the constraints specified by this framework. In Java development, the framework is represented by a set of rules + a group of jar packages.
2Why: Why do we use frameworks?
(1) Reason: It is like building a house. 10 people work together to build it. At this time, the framework is like a drawing. If there are no drawings for building a house, then everyone has their own ideas, and the house built must not be what the homeowner wants. And with the drawings, we can constrain everyone on how to build our house, what shape the bricks should be cut into, and how the doors should be facing south and north, etc., etc. are all constrained. This facilitates team collaboration and development. In our development, if the name of a class is named A.java by classmate A and B.java by classmate B, in fact, the functions of these two classes are the same, but it is because there is no standard that it causes problems. It is confusing and not conducive to teamwork and development. If a framework is used, the framework will have restrictions on the names of classes. For example, in Struts, we name the control class **Action so that people can easily understand the function.
(2) Significance: The framework not only completes these simple constraints, but more importantly, the framework encapsulates some redundant and low-reuse code for us. And use reflection and dynamic proxy mechanisms to achieve code versatility. For example, if you are talking about servlet development, you need to get the parameters of the form in the servlet, which is very troublesome to get every time. The bottom layer of Struts uses the reflection mechanism and interceptor mechanism to help us get the values ??of the form, so we don't have to write them by hand every time. Code, simplifying development, of course you must comply with some regulations to configure. There is also hibernate, which provides some very versatile additions, deletions and modifications to the database. If you use jdbc, you must write sql every time you do some simple crud, but you don’t need to be so troublesome with hibernate. You can directly Just save and update. . . Of course, you still have to follow some of its specifications for configuration. The same is true for spring.
3 How to use As mentioned just now, the framework is embodied in jar in java. If using this is something to learn, I can't tell you, but first you need to import the jar before you can use its "regulations". First write helloworld. . . Learn slowly. . .
Supplementary benefits and disadvantages of frameworks: The benefits of frameworks have been mentioned a lot. They facilitate team development, provide some ready-made mechanisms, simplify development difficulty, and some frameworks can be decoupled, such as spring. The disadvantage is that the efficiency is not as high as servlet development, but with the improvement of hardware, these are not problems. The difference is not big. In fact, if efficiency is required, servlet+jdbc is the best, but if you consider many aspects, it is better to use a framework.
What is message middleware
1 It is used to improve system performance:
A simple understanding is that the application does not need to care about the part of processing results, and can be asynchronously through message middleware notification message. Then other application servers receive the message and process it slowly.
2 Application decoupling and communication:
A simple understanding is data interaction between multiple applications.
Example: When sending a text message, you cannot wait until the text message is sent successfully. Then process the logic, so you can use the message middleware to notify the system that can send text messages to send them slowly.
The Mybatis Shiro you mentioned above belongs to the java framework, RabbitMQ and Redis belong to the message middleware, and Eureka is the registration center, which is equivalent to the java client. I hope it will be helpful to you. If you want If you want to have a deeper understanding of this aspect, please follow me and send me a private message to help you play with java