Frame outside, frame outside

Source: Internet
Author: User

Frame outside, frame outside

Today is 4th. I resigned on the first day. Today, I did not go to work on the seventh day. I have been working in the company for five years. I have changed several jobs over the past five years, but I have not stayed for more than one month. Although I often change jobs, I have been taking the technical path, and all of them are C # desktop software development. When I resigned, my reason was that I was not interested in the business and took the technical route. The company was still a traditional software development company and adopted a conservative attitude technically. The company is profitable in performance and cannot allow programmers to freely write code of interest. A project manager engaged in delphi development brought the C # team to emphasize rapid development, and the final product problems continued. Such problems only exist in the company.

Let's talk a little bit about the framework. The last framework was restructured by myself and added the routing and communication mechanism, multi-thread asynchronous loading, synchronous control, replacement of osgi assembly loading and other functions. The descriptions are as follows.

Route communication: the object in assembly a. If you want to call the B object in assembly B, you can find the B object through the main interface. The main interface is completely Dynamically Loaded and dynamically controlled. The main interface is divided into modules, plug-in, form.

A and B belong to different modules and different forms of different plug-ins. How does a call B to directly switch over the main interface rather than the pop-up form? This mechanism is routing communication, communication means passing parameters.

A only tells the main interface that I need to find B with the parameter information. The rest of the work is done on the main interface. Dictionary is the fastest data structure to be searched. You need to maintain the plug-in and module of Form B into a dictionary. (All form objects on the main interface must be maintained in this dictionary ). Messages in C # are encapsulated into events. Therefore, you need to put the event processing function of the form on the main interface for management. Form a only triggers events and is processed on the subscribed main interface. For uniformity of parameters, I use a dynamic object that receives the form and then returns the parsed object.

From a software login to the main interface, the user is certainly not willing to wait, which means that the faster the main interface is, the better, but the dynamic building of the main interface, if the logic data is complex, loading is certainly slow, the logon logic also needs to determine many conditions and some initialization work of the entire system. Open a thread to run the data on the main interface before the logon interface is displayed, and then run a thread to retrieve the data on the logon interface. The logon interface uses this. Update () in the shown event, which means that the logon interface appears immediately and then runs the data on the logon interface. [Another method is to send a user message. The user message will be executed on a thread. After the Load event is executed, the interface will be updated immediately. this. update (), and then execute the message processing process. In this way, the interface and loading can be separated .] After successfully logging on, run another thread to fetch some cached data.

If the main interface comes out, if the thread that starts to run the main interface data has not been executed, it needs to be controlled synchronously. Of course, C # has many synchronization mechanisms, and I use a simple Lock.

Let's talk about the caching mechanism of the client software and put the infrequently changed data into the local json, so that you can directly retrieve the json without going to the server every time. Put some objects that have been used for a long time and remain unchanged throughout the session into the memory, instead of getting server data every time. The plug-in system only needs to update the changed dll when updating, without the need for other assembly. First, let's talk about the Assembly query sequence. 1 is found in GAC, 2 is found in codebase, 3 is found in the root directory, and 4 is found in privatepath. Because the elements on the system interface I designed can be configured in the database and belong to the user's permissions. You can also control the plug-in.

The last month before I resigned, I mainly engaged in hot swapping and used the concept of a program domain. Proxy executes operations in the program domain instead of real objects, and uses reflection in the program domain for interaction between different sets. It does not feel like a framework. This is only the test code left by me.

In other words, the framework depends on rules and the business depends on requirements. Good frameworks and codes are well-developed through continuous refactoring.

I resigned, but my life in the company has come to an end, and I will be more free to develop products that I am interested in.

One of the most important qualities of a man is to be positive and follow the long journey. I will go up and down to seek help!

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.