Experience Sharing series of the. NET crazy architecture of the big wicked man Jiri gala with fire, magic, closed doors, and cars (I) Background control logic Code Section

Source: Internet
Author: User

I also share my code structure with you in good faith. You are welcome to give your criticism. First of all, why do I write this title as wicked? Because I like to provoke others, because I like to communicate with others, point out others' shortcomings, and secretly learn others' advantages, so everyone will dislike me, because I often talk about the shortcomings of others, not the advantages of others. At work, I also like to be true and pursue perfection. It is this persistent idea that I have never been obsessed with software.

Why do I say that I am "Behind Closed Doors", because you often study your own things in depth, it is easy to keep up with the trend of the times, it is too late to learn new technologies, because you have a heavy burden that requires complete maintenance and careful maintenance every day, otherwise it will be exposed. This is often the cause that you are easy to become a slot. In a derogatory term, it is "closed doors.

Most of my dream is to have a perfect system architecture. I just tried 7-8 years to set up the perfect architecture. Now I want to change the perfect architecture in my mind to RMB, in the process of looking for how to turn into RMB, the perfect architecture is not something that a person does. It requires you to die several times a year and be extracted after several years of death, in addition, if you hone your willpower, you will give up the idea at least 3-4 times, get rejected by many people, and be able to develop it only after the practical test of many projects, there are many good things, but no one will explain them to you, and I will not study them seriously. Just like the 1g C # documents I downloaded, there is a lot of e-waste, every day after this new technology, it is difficult to extract something, because you will never keep up with the progress of the times, your accumulation will become your burden, unless you have amazing perseverance, constantly Improve Your accumulation. At least you have to spend a few years without playing games to extract them, or the company has to pay for them to burn them out.

It's not a new technology. Your previous accumulation has been pushed down. Unless your previous accumulation cannot withstand the test, it will not be pushed down. New technologies are just icing on the cake, the idea of managing the overall development of software will not change dramatically. You need to constantly absorb new technologies, understand the strengths and positioning of new technologies, and then digest the new technologies, use your own overall architecture.


My overall thinking is shown in the figure below

Figure 01]
 

I am not asking you to do anything, but what I can do, but what I have already done. Despite your demand, I have mature solutions and ideas here, I can make mass production right away. What management system do you need? What system do you want to develop? If someone else needs 6 months of development, I may have finished the development in 3 months. Others need 10 developers. I need 5 developers, people say they need five mature developers. I say five interns are enough. This is my advantage. I don't need a company to charge me for developing a platform, I have it now and it will take effect immediately. Why do I require a high salary? Because I am not at risk, I have invested a lot of energy for this. I have never given up on my accumulation, but I have never given up on perfection. The dream of ordinary programmers has already been realized, now I only need to wait for the opportunity and find the opportunity.

The core starting point of architecture:
01. The same code can support multiple databases without modifying the code.
02. It has enough scalability to be compatible with the future development of new technologies.
03. Effectively accumulate your project experience.
04. The high speed of big projects, depending on the development and management software for entertainment, has encountered several opportunities throughout the life, and the xianyu (hundreds of thousands, millions of software projects ).
05. constantly use new technologies to improve the architecture.
06. I am so energetic that I am idle and have no other interests or hobbies. I don't like football or play games.
07. Software is doing well, and money is indeed fast, and it can be empty glove white wolf, do not need much capital.
08. Writing a program may be CS or BS. You can use any running mode in Service, WCF, Remoting, or WebService for the same code.
09. Establish a general and scalable permission model and create a permission to deal with all commercial software.
10. Supports hierarchical deployment on different servers, such as Oralce database server, commercial logic server, and Web Server (without any Oracle components installed.
11. After the adoption of new technologies, it will not be completely overturned. Local improvements will not affect the overall architecture and existing accumulation.
12. Everything exists as a service and object-oriented strong programming.
13. To be able to cope with the difficulties you want, how can I play with you, quickly meet your demanding requirements, and quickly absorb good suggestions.
14. The code is easy to understand and can be imitated in mass production. We don't play with the technology. We make money in projects. No matter what technology you play with, the customer only looks at the results.
15. Customers do not need to process as long as the results are met. We usually make good preparations. As long as the customer receives the list as quickly as possible, the customer does not have time to make any effort with us.

Look at the picture.


Figure 02]
The main part is the background code section. The architecture of the Code Section for future generations is explained in a logical order.
01. DotNet. Common. Utilities.
02. DotNet. Common. DbUtilities.
03. DotNet. Common. Model: Model definition. It mainly refers to the classes that my system processes.
04. DotNet. Common. Business: Business logic. Here, we mainly compile the core Business logic and gameplay. This accumulation is very important.
05. DotNet. Common. IService: Service Interface Definition. Here we mainly declare what interfaces are provided for my service methods.
06. DotNet. Common. Service: Service implementation part: Here is the Service program part of the SOA system. All the services provided externally are implemented by calling here.
07. DotNet. Common. RemotingServer: remote service part: mainly the server part that implements Remoting.
08. DotNet. Common. WindowsService: Windows Service Section: It mainly implements specific services in the form of Windows Services.
09. DotNet. Common. WebService: Web Service Section: Implements your own services in the form of Web services.
10. DotNet. Common. WebService. Client: Call part of the Web service Client: Call Implementation of WebService.
11. DotNet. Common. UILayer. Utilities: Common components of traditional CS projects, which can be used to quickly improve development efficiency.
12. DotNet. Common. UILayer. WinForms: In the traditional CS project, each subroutine can be run independently or become a module of the parent program.
13. DotNet. Common. UILayer. WinForm: Main Program of the traditional CS project.
14. DotNet. Common. Web: part of the traditional BS project.
15. DotNet. Common. Example.


Figure 03]

It is mainly the structure of the background model definition. There is almost no commercial logic code here, which is purely the definition part of the model. What is money? The model is money. For example, if you want to make a simple workflow, you cannot understand the fields required to create several tables. You have accumulated these fields and the table structure is in place. Whether it is using Java, PHP, C ++, you can quickly enter the status. In fact, when we develop the management system, what tables should be created, such as those fields. In other words, it takes a long time to establish a domain model. We often make a lot of effort and time.
What is a field expert? The Model Code corresponds to an expert in the field. Once you have accumulated more, no matter what technology is used for development in the future, the development speed will be improved quickly. It is easy for everyone to ignore and cherish their own models, after N years, we will find that model accumulation is more important than program writing.


Figure 04]

The above [figure 04] function mainly defines a data table and a database field. It mainly takes into account the following points:
1: Due to our poor level of English, we do not like to name fields in Chinese, and we do not like to name fields in Chinese, so we often have field names that are not in the middle of the world, it is even possible that verb names are messy, including me. Therefore, field names are often changed. We can only solve this problem, I define constants in the program, and then use these static variables in the SQL statement to reference them. In this way, when the field name changes, errors will be reported in all other parts of the program, I can modify the program very well, or even use another naming method. It is very convenient to modify it, and it will not be detected during running.
2: The table name and field name can be set during the program running stage. For example, if I used your class library, but my table structure is different from yours, I can configure it through the configuration file, then the program will assign values to these static variables, so that the entire program changes to modify a variable, only need to assign a value once is enough.
3: Comment on the table name and field name. I followed the program. When I write a program, it is easy to find the structure description of the table, so I don't have to go to the database any more, or open another designer or something. Although this is a small improvement, the description of the table structure will not be lost after a long time. It works very well. I also suggest you do this.

Experience: I used to write the code manually. I had a lot of work and was rejected by everyone. Later I used the code generator and didn't have to write it myself. It was easy, the code can be generated three or two times, but it is a little difficult to use constants in SQL statements, but there will always be a return for the payment. When you indicate that the field name has changed, the program will also be very stable, even you can rest assured, otherwise the database table name changes, the field name changes, will lead to a lot of people, and everyone did not dare to easily correct the table structure, you cannot change the name even if you know the name is wrong.


Figure 05]

The above [figure 05] function is mainly a database ing function, mainly for the following features to be extended
1: the software you write may need to run on someone else's database. It is very likely that someone else's database table name and field name are different from yours. You can make a ing, your program can run smoothly on other people's databases.
2: Due to our poor English proficiency, we often find that my table name and field name are

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.