Implement your own framework series step by step (1): Preliminary Architecture Function Design

Source: Internet
Author: User

I think many people have the desire to write their own frameworks, which can be used by various applications. However, for various reasons, I often imagine that I did not implement it step by step, and I am one of them. Whether you are a newbie or a newbie, you are welcome to visit. No matter whether it's a brick or a performance, why not leave traces to commemorate it?

You need to plan your life, and the architecture is the same. If you don't have a plan, you will eventually deviate from the original idea.

Just like a ship whose name is not named in a ganzheng's biography, a ship without a name is unlucky, so he gave the ship the Jenny, his favorite girl's name. Let me give myself a name for the frame, and I will give myself a single stick. Let's get my nickname GL.

First, specify our initial goal. I hope my framework involves the following features:

1. First, use the C # language.

2. What we need to do is the CS architecture

3. In addition, I hope my framework is flexible and scalable, so this is a plug-in platform.

4. communication-related WCF

5. The client uses the WPF interface to display the interface, so that you can make attractive programs. I remember a saying that a project with good presentation techniques and bad frameworks may not pass through, but a good framework, without a good expression, this project will certainly not pass. It's just like we all like beautiful women.

6. The exception mechanism should not be missing and there is no platform for the exception mechanism. I think it should be poor.

Now that we have our initial goal, the next step is to design the basic framework.

A server corresponds to multiple clients. Each client creates a session on the server. Each time the client opens a page, the server creates a page service in the corresponding session, data exchange between the client and the server uses WCF. A simple framework involves this. If you think there is anything wrong or something to improve, you can leave a message to me, this is just my preliminary idea. I have not touched many architectural aspects. You are welcome to recommend some excellent design exchanges.

Without a clear idea, it seems clumsy to start with things. Let's design my page interface.

I think page lifecycle initialization and shutdown are indispensable. In addition, communication between the client and the server is necessary. In this way, the page interface is clear and clear, and our subsequent design will be handy.

Since there are pages, there will be a lot of pages on the client server. If there is no reasonable design, there will be confusion, so there will be a need for page management.

Okay, I admit that I don't know how to use Visio. I don't know how to design a single attribute, and I don't have any parameters for the returned values. You just need to understand the illustration. Just pat on some clean guys, the example is a simple interface design for the page manager, and our goal is further clarified.

A server is connected by many clients, so it cannot be separated from the session.

The role of session is to set up service scopes for each client to facilitate server lifecycle management,

The session manager needs to manage fine-grained objects.

The basic design is available, and the design objectives are clear and clear. The following is the hands-on time. This article is here for us. We will be very practical. If you are interested, please listen.

  

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.