Write your own C # framework from scratch (28)-modeling, architecture and framework,

Source: Internet
Author: User

Write your own C # framework from scratch (28)-modeling, architecture and framework,

I have been hesitating to continue writing about the design for Small and Medium-sized frameworks or to write some advanced content on the framework design? For small and medium systems, you only need to refine the previous content and write the detailed development details in chapter 5 to illustrate how to develop the general framework, for small and medium-sized systems, it is not very complicated. Simply understanding the three-tier architecture is enough, and using too many designs is a bit cool, basically, no one will spend too much design work on small and medium-sized systems. For the Framework Design of large-scale platforms, I deeply feel that my accumulation is far from enough. Writing it out may mislead everyone. However, it is hard to clarify the design idea of the framework without changing the mindset. It is difficult for others to clearly understand what the framework is after obtaining the source code of the framework, how to transform it. Therefore, we can only share our learning experience with you and hope that we can better summarize our learning achievements. Of course, some ideas are not necessarily correct, I also hope that you can point it out directly.

 

Preface

Many of my friends may wonder why modeling is the first thing to do to build a development framework? Can we build a framework? People may directly say that the core of designing a development framework for this 2B should be the three-layer and five-layer architecture. What should each layer be useful, how can they decouple and call together ......

If someone told me how to design a framework in the past, I would also feel that it is so complicated to get a development framework and how to do it directly with several layers and tool classes, then write some common functions.

In fact, since I wrote this series, the theoretical part has been pondering how to explain it in a more easy-to-understand way. As in the previous chapter, I will talk about it directly from the three-tier architecture, the relationship between them can only be easily explained, but why is this framework designed instead of that? The frameworks described in the previous sections can be used for website backend management directly, but can they be used as e-commerce platforms, OA, CRM, supply chain... and other software frameworks? Is there a problem? How can we improve it? If the development framework is used for e-commerce platforms, when the access traffic increases, and the server needs to be added for distributed and load balancing data distribution, is it necessary to transform the existing framework to support or design a new architecture? How should we transform or design it? What kind of business does the designed architecture support? How can I enable the requirement provider (not a technician) to participate in Architecture Design earlier? How can we identify system framework bottlenecks as soon as possible? How can we solve many problems from the design layer? How can new recruits quickly understand and master the entire framework and quickly join the development queue? If you want to avoid the problem that the core technology is only in the hands of one or more people, when one of these people leaves, other people cannot take over quickly? Can the designed system be split into independent modules based on the business, so that testers can join the project in advance to improve the quality of the project? How can we unify the split modules ?...... The more questions you think about, the less points you can describe.

After the accumulation of knowledge, I gradually realized that all the methods I have been using are process-oriented methods to analyze the requirements. When I design a project or architecture, I designed it for the purpose of functionality and design it for the purpose of design, I don't know why. If the framework is suitable for the project, you need to analyze the requirements and design the architecture based on your actual needs and development direction, it is object-oriented. It uses use cases or fields to drive the design and customizes the system designed for specific needs, instead of having too many architectural functions or failing to meet the design requirements, or after a while, the entire architecture and even data tables have to be replayed.

Of course, the above are all systems designed in an ideal state. In actual work, the architecture or platform under development is designed to survive every major version update, haha ...... most of the time, we have to perform major operations and make major changes.

 

Relationship between UML, architecture and framework

Du Niang said:

Unified Modeling Language (UML), also known as the Unified Modeling Language or standard Modeling Language, is a graphical Language that supports Modeling and software system development. It provides Modeling and visualization support for all stages of software development, this includes requirement analysis, specification, construction, and configuration.

A software architecture is a system sketch. The object of the software architecture description is the abstract component that directly forms the system. The connections between components clearly and in a relatively detailed manner describe the communication between components. In the implementation phase, these abstract components are refined into actual components, such as a specific class or object. In the Object-Oriented field, interfaces are usually used to connect components.

For the frame, it is a reinforced concrete structure, which can be used to build parking lots, shopping malls, hotels, restaurants, and commercial housing for various functions ......

 

For the framework, the architecture is a drawn building drawing, which describes the exterior shape, interior layout, structure, interior and exterior decoration, material practices, equipment, construction and other drawings of the building. UML is the various shapes (symbols) drawn on these drawings ).

 

A lot of friends will say that I don't need to use UML and don't understand the architecture to develop a set of frameworks with different functions. To learn so much about dry code, just do it. Indeed, direct coding is a good choice for simple functions, small and medium-sized projects, or architectures with many similar frameworks. For a large, complex, or high-risk project, or a project in a field that you are not familiar with, do the relevant design work before development, it helps you reduce the risk of project failure.

The framework is not omnipotent, and not applicable to any system. Even a general management permission framework has its limitations. For example, the open-source framework code in the previous sections of this series is relatively powerful in the permission management module, but there are also various drawbacks. For example, it is used for a simple enterprise Web site. It is a transitional design and adds many unnecessary functions to make development complex. For an enterprise management software, its permission granularity is not fine enough. For example, it is not implemented if different roles need to display different content lists. The ORM framework of the underlying application also limits the use of only MsSql databases; slow execution efficiency on the UI Layer ...... therefore, when designing, we need to design different architectures based on specific needs. The best choice is the right, rather than the most powerful pursuit at any time.

The architecture is like a software skeleton. Different designs are suitable for different fields, just like the skeleton of a bird is suitable for flying, and the skeleton of a leopard is suitable for running, if the well-designed architecture needs to be hard-wired to change its applicability to other fields, it will not be impossible, which will increase the difficulty, as if it was intended to make the birds run like a leopard, you can fly again.

In the actual development process, many projects cannot be completed by yourself. In the collaborative development of teams, how can we make everyone understand your intentions, to work with you to develop projects, you need to use relevant tools (UML or other modeling languages) to easily draw business cases, various views, and models, to help you understand and cooperate.

For large, medium, and small projects, the time spent on architectural design is different, according to Barry W. boehm-father of the COCOMO model of the Software Engineering Estimation Model and father of the software process spiral model). For small projects, only about 5% of the time is required. For large and medium-sized projects, 33% ~ of the total time is required ~ 37% of the time; for ultra-large projects, 40% of the time is required.

 

Benefits of modeling applications in actual development

1. allow non-technical personnel to understand the business content that the developed system can process in advance

For non-technical personnel, they do not understand various types of code, and business use cases allow them to understand in advance what functions will be implemented and whether they want the content.

2. Allow testers to participate in the project in advance

After the model is created and discussed, relevant testers can write test cases and related automated test interfaces, so that developers can understand the test content and ideas, you can participate in the test in advance and provide more comments and perspectives for the test to improve the program quality. In addition, when the program completes development, you can run the automated test code immediately, speed up the test.

3. let developers have a deeper understanding of the project to be developed

For most projects, apart from the architecture designer, other developers only have a thorough understanding of the software framework and are only familiar with their own work. They do not know much about other modules. This has caused many communication barriers. Even if he is responsible for more functional module development, he only needs to know more about it, when the functional limitations of the software architecture support business expansion and the software architecture needs to be transformed, few developers dare to modify the underlying framework code at will, this is mainly because you do not know your architecture, and are afraid that the changes will affect the normal operation of other modules. There are mature architecture documents, which will help developers understand the operating mechanism of the software framework, the relationship between modules and components, give them the ability to transform the software framework with confidence.

4. Make it easier for new developers to understand the project

When a new member joins the development team, the biggest headache is how to quickly take over the project and put it into development. With the relevant architecture model ,, developers can quickly understand the entire development framework and its technical points by simply viewing the architecture model and corresponding documents.

There are many other benefits that we will not discuss here.

 

Copyright:

This article was originally published by AllEmpty and published in the blog Park. You are welcome to repost it. You must keep this statement without your consent and provide the original article link clearly on the article page,Otherwise, the right to pursue legal liability is reserved.. If you have any questions, you can use1654937@qq.comThank you very much for contacting me.

Publish the content of this series,MasterYesIt is to learn and make progress together with everyone. If you are interested, you can add Q group: 327360708. Let's discuss it together.

Friends who work in Foshan can also join: Foshan IT friends group 263767221. You can share resources and make progress together. If you have time, you can come out and get to know about the technology. Haha

For more information, please refer to blog: http://www.cnblogs.com/EmptyFS/

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.