In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to understand the web shared meta mode". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to understand the web shared meta mode".
Intention
Avoid repeatedly building the same data or objects between different objects by sharing.
motivation
The application of object-oriented design technology enables programmers to regard individuals in the system as an independent object when dealing with complex systems, thus greatly reducing the complexity of processing. But this kind of treatment sometimes brings some problems.
For example, recently we can often see examples of using a large number of drones to pose in the air. Thousands of drones display various patterns in the air, and the scene is called a spectacle. Today, we will take the communication of drones as an example to illustrate the shared meta-mode. First of all, here are two hypotheses:
The number of drones is so large that multiple brands of drones are needed to perform together.
Drones produced by different manufacturers can accept different types of commands, forms, and modes of communication.
In order to be able to control these drones in the same way, we can design a conversion class of the communication protocol, and the instructions issued by the users are translated into the protocols used by various manufacturers and models. The next step is to prepare the protocol conversion data for each UAV. But we are dealing with thousands of drones, and preparing each drone requires a lot of memory.
This problem can be solved by sharing meta-mode. Since the same manufacturer and the same type of UAV can accept the same type of command, form, and mode of communication, we only need to provide a unique conversion module for each model of each manufacturer.
Each time you need to use Translator, the user calls the GetTranslator method of TranslatorFactory with the manufacturer and model as parameters. If the TranslatorFactory already holds the Translator that matches the manufacturer and model, it will be returned directly. If not, the corresponding Translator will be generated and returned. This ensures that each manufacturer and model of UAV will generate only one Translator, thus avoiding the waste of memory space.
Thank you for your reading, the above is the content of "how to understand the web meta-mode". After the study of this article, I believe you have a deeper understanding of how to understand the web meta-mode, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.