当前位置:网站首页>Cb/s Architecture - Implementation Based on cef3+mfc
Cb/s Architecture - Implementation Based on cef3+mfc
2022-06-30 09:30:00 【Ancient wood technology】
One 、 Why use CB/S framework
- I do VC++ It has been developed for many years , The biggest feeling is MFC The interface is too ugly 、UI Interface library calls are tedious ( Technical effectiveness personal view - Because the interface library is based on DirectUI Technologies do not support stand-alone window handles , For event acceptance /GDI mapping / And so on is very inconvenient , such as :DULIB/SOUI/ Colorful interface library )、 Need artists ( Small companies have limited costs )、 The client upgrade is troublesome ( It needs to be compatible with various system versions )... wait , No make complaints about it. !!
- Maybe you asked , For god horse does not use C# Wait for interface development , The main consideration is to be compatible with various system versions , Need to install .NET The environment is troublesome , If it is used in a single project with a self-service terminal and other environments, it is still good .
- To solve the problem of beautiful interface 、 Easy to update 、 The old project is easy to transform , I decided to use CB/S Architecture to solve the above problems , I use MFC+ Google browser CEF3 Realization CB/S framework , Because at present, the company's clients are MFC frame , Therefore, it is convenient to quickly replace the old version client .
3、 ... and 、CB/S Architecture implementation
because CEF3 Support C++ And JS Call each other , So the client only needs to implement one js call c++ A common interface to the , Parameters can be passed through json Structural data control implements different functions and passes different types of parameters .
1、c++ call js It's simple , Call directly js Function is OK
Such as :c++ call
Such as :js Accept function
2、JS call c++, More trouble , You can refer to (https://blog.csdn.net/foruok/article/details/50573612)
According to personal preference , I only realize one CMDFunction Interface , adopt json Parameter control realizes different functions .
Such as :JS call
Such as :C++ Accept and implement (V8 The engine received CMDFunction After the parameters of the function , Occurs to the main window for processing json Data and realize corresponding functions )
The final results are as follows :
Two : Introduce CB/S framework ( Reference resources :https://www.cnblogs.com/liulun/p/3433003.html, It's very good )
1. What is the CB/S Applications for
C/S Structured applications , The client side. / Application in the form of server , This kind of application needs to install a program on the client's computer , The client uses this program to communicate with the server , Complete certain operations .
B/S Structured applications , It's a browser / Application in the form of server , This kind of application doesn't have to deploy anything on the client side , The customer only needs to communicate with the server through the browser , To complete certain operations .
The advantages and disadvantages of the two types of programs are compared :
Comparison content | C/S Structured applications | B/S Structured applications |
Deploy | More difficult | convenient |
upgrade | More difficult | convenient |
Control permissions on the client | high | low |
Data real time | high | Higher |
Communication efficiency | high | Higher |
Cross-platform sex | weak | strong |
It can be seen from the above that , Both forms of application have pros and cons . When the architect is making technology selection , Often according to the needs of the project , Compare the advantages and disadvantages of these two technical forms , Make the right choice .
However , Most enterprise applications in China , It needs to be frequent 、 Timely update and upgrade 、 Higher client control permissions are required 、 Higher data real-time performance and higher communication efficiency are required , But I don't care about the deployment problems .
At this time , The architect thinks about C/S Structural applications and B/S Structure of the application , Let the client nest a browser to communicate with the server , Complete certain operations . Such a program is CB/S Structured applications .
The advantage of this is that the general business logic needs to be updated and upgraded on the server side , It can be displayed on the client . For client system permissions 、 be based on Socket Communication and other operations that cannot be completed by the browser core , It can be done by the client . The client can communicate directly with the server , You can also communicate with the server through the browser core .
The following figure for CB/S Basic diagram of the structure application :
At present, there is another kind between C/S and B/S Structure of applications between applications :RIA Rich Internet applications , Applications with this structure are generally based on browser plug-ins , It has high client control permissions ( Than B/S Cheng Xugao , But more than C/S Program low ), There are also many options for communication modes ( Not just based on HTTP agreement ), At present, the more common RIA Technology has :Adobe Of flex technology 、 Microsoft Silverlight technology 、Oracle Of WebStart technology . When the architect is making technology selection , These technologies can also be comprehensively weighed . |
I am QQ:1255033066
Welcome guidance
边栏推荐
- Baidu map JS browsing terminal
- Esp32 (4): overview of the overall code architecture
- JPA naming rules
- So the toolbar can still be used like this? The toolbar uses the most complete parsing. Netizen: finally, you don't have to always customize the title bar!
- MySQL-- Entity Framework Code First(EF Code First)
- Duplicate entry '2' for key 'primary appears in JPA‘
- Treatment process record of Union Medical College Hospital (Dongdan hospital area)
- Using OpenCV Net for image restoration
- Challenge transform() 2D
- Common query and aggregation of ES
猜你喜欢
I once met a girl whom I most wanted to take care of all my life. Later... No later
Esp32 things (II): sharpening the knife without mistaking firewood - make preparations before project development
Deeply understand the working principle of kotlin collaboration suspend (beginners can also understand it)
Microsoft. Bcl. Async usage summary -- in Net framework 4.5 project Net framework version 4.5 and above can use async/await asynchronous feature in C 5
Esp32 things (3): overview of the overall system design
Bottomsheetbehavior principle of realizing the home page effect of Gaode map
Opencv learning notes -day13 pixel value statistics calculation of maximum and minimum values, average values and standard deviations (use of minmaxloc() and meanstddev() functions)
Applet learning path 2 - event binding
Sort (simple description)
Talk about the job experience of kotlin cooperation process
随机推荐
Create thread pool demo
Demo of guavacache
Startup of MySQL green edition in Windows system
Talking about the difference between kotlin collaboration and thread
Idea shortcut key settings
Reading notes of "Introduction to deep learning: pytoch"
Why must redis exist in distributed systems?
Harmonyos actual combat - ten thousand words long article understanding service card development process
Function simplification principle: save if you can
Talk about how the kotlin process started?
Guilin robust medical acquired 100% equity of Guilin Latex to fill the blank of latex product line
Using OpenCV Net for image restoration
Explanation on the use of password profiteering cracking tool Hydra
Esp32 (7): I2S and I2C drivers for function development
Baidu map JS browsing terminal
ACM intensive training graph theory exercise 3 in the summer vacation of 2020 [problem solving]
Use of Baidu face recognition API
Niuke IOI weekly competition 20 popularization group (problem solving)
Properties of string
Code management related issues