Recently, our team has partnered with an operator to build a software supermarket platform based on our osgi. NET Framework. As shown in architecture 1, the platform consists of the App Store platform, app runtime, and developer toolkit. It builds a unified platform for software providers, operators, and consumers. During the platform design process, I developed a technical solution based on the customer's needs. However, due to changes in Intermediate requirements, we need to temporarily adjust and build new technical solutions. I think the selection of these two technical solutions is very interesting. These two solutions are both very easy-to-use for both developers and consumers from the user perspective. Therefore, write it down and share it with you.
Figure 1 architecture of appstore
In Figure 1, app Runtime is the running container of an application developed by a provider, while Dev SDK is the developer toolkit for a specific app runtime.
Solution 1: Build stand-alone applications for enterprise users
This solution means that app Runtime is the running container of a traditional winform application, and all applications running in this container are winform applications (in fact, this is not the real requirement of the customer, the real requirement of the customer is the B/S model App runtime ). This means that the dev SDK is also designed for the app runtime of the winform running container.
The runtime interface of the app we designed is roughly as follows:
Figure 2 App Runtime
The idea design is as follows:
(1) app Runtime is composed of osgi. Net kernel, winform interface plug-in, SQLite Data Access Service plug-in, and RBAC service plug-in;
(2) As the underlying framework of APP runtime, osgi. NET provides functions such as modularization, plug-in, dynamic, service-oriented, and module extension;
(3) The winform interface plug-in defines a unified interface framework and provides navigation bar and content area extension points for all applications, allow apps developed based on dev SDK to dynamically add menus to the left navigation area, and display the user-defined business logic interface to the right content area;
(4) The SQLite Data Access Service plug-in is a standalone application data access service, which encapsulates Data Access to SQLite;
(5) RBAC service plug-ins provide unified user permission management. You only need to add extensions to the plug-ins, the extended format is a set of <permission id = "<pid>" displayname = "<dname>">, and then calls its provided permissionservice. the checkbyid method performs permission detection. This method provides extensions to RBAC at any level. In addition, it provides several basic management interfaces, including user and permission management;
(6) Dev SDK is an application development kit for developers. It consists of application templates, vs plug-ins, osgi. Net kernels, Remote Management Console, documents, videos, and examples. The Default Application Template is a vs2005sp1/vs2008/vs2010 Project template, A template-based project consists of an empty SQLite database, an activator that obtains dataaccessservice and permissionservice, and a module configuration file that includes permissions and interface module extensions, as shown in figure 3. The default project created by this Dev SDK automatically injects a navigation bar to the winform interface framework once it runs, and the form1 and usercontrol1 controls can be displayed in the content area, as shown in figure 4.
Figure 3 Project template structure of creating an application using Dev SDK
Figure 4 default project running result
The advantages of this solution are as follows: (1) for software providers, developing applications is very simple and there is almost no difference with traditional development methods, it also provides a good interface, general data access, and general permission management module. (2) software consumers can install, add, and uninstall applications at any time. The overall style is very consistent. Throughout the design of the solution, I designed their application scenarios based on the roles of the three users, and wrote a functional specification when I thought everything was perfect.
Originally, I have submitted the functional specification document (5) of this project to my partners, even if he looks at the specification at a glance, he can also see that the outdated winform technology does not meet the requirements (I have previously questioned this point, but because the customer's attitude is very positive, I thought I had mastered the customer's needs. However, if the partner did not read this document, they may have been too confident about us. This mistake may be because both of us believe that we have understood the ideas of both parties. In fact, it is not really perfect. It was not until the prototype had been demonstrated to them that they raised a very serious problem. They said that the design could not meet the requirements, at least for c/s or B/S applications, and it could not be a standalone version (the standalone version does not have a white design, and we have other applications ). Then, my team and I began to design and select the next round of solutions.
Figure 5 Design of APP runtime in appstore specifications
Solution 2: Build a c/s application or B/S application for enterprise users
For C/S applications, real-time and interactive features are a major benefit. However, if you use the C/S mode, the consumer will encounter two very difficult problems: (1) how to install the server is the first problem, you need to install the server first, then install the client. Each client needs to configure database connections. This method is too complicated for consumers. (2) If you want to add or delete a new application, this means that all clients need to be changed, which is even more fatal. If we have to use the C/S mode, we must solve these two problems. We can combine only one method to solve the problem, namely, the Smart Client technology. Every user installs the application through the server and subscribes to the server to update the application in real time. This method is technically feasible, but makes the problem very complex and easy to use. Therefore, we can only use the B/S mode.
For the B/S mode, it brings two new problems: how developers develop and how consumers use them. If the answers to these two questions are very difficult, it means that this solution will not meet users' needs. Ease of use is the first choice for a software product!
First, the question about how consumers use it is a little simpler: (1) premise: the user installs IIS; (2) the downloaded app runtime + apps installation package automatically publishes the application to IIS. The newly added application can be automatically copied to the Plugins directory, which causes IIS to restart.
For developers, we have introduced a new discussion. That is, the Development Mode Based on the standalone version cannot meet the B/S mode. There is a fatal problem here. The local SQLite database does not support multithreading, while the B/S application is multithreading, which means that if SQLite is used, data access must encapsulate a unique thread to access the database like winform, and enable different application browsers to access the database serially Based on the thread synchronization technology, and does not support LINQ and ADO. NET Entity Framework. This is too restrictive for developers. We do not want this.
Refer to all commercially available File databases. Another alternative solution is SQL ce. Only good. There are too many SQL ce versions and they cannot be unified. Therefore, we gave up on the standalone version of APP runtime. However, it does not have the advantage of SQLite, that is, it provides concurrency support. My team and I discussed this issue from the perspective of ease of use and came up with a compromise solution: (1) porting the standalone version to the B/S mode; (2) the first is the current stage: Restrict developers to use vs2008 SP1 + SQL ce3.5 SP1 for development; (3) Stage 2: osgi.. net packages multiple versions of SQL ce runtime, so that you can use any version of Vs and Ce to develop applications.
In this way, we finally propose a feasible solution.
Declaration: The winformshellplugin design uses some open-source components, including the vtab of John Underhill (steppenwolfe), The navigationpanel of Muhammed ş Ah İ N, and the skinform of starts_2000. Of course, we have also decided on SQLite. Here, thank you for sharing them !! Recently, my personalized signature has become "WriteCodeJust like watching a movie, it is already a way to relax. "It's a simple, easy, and simple thing to write code ~~, I haven't updated my blog for a long time.