Open Source: Taurus. MVC Framework, open source taurus. mvc

Source: Internet
Author: User

Open Source: Taurus. MVC Framework, open source taurus. mvc
Why create Taurus. MVC:

I remember the situation when I was fooled by a company to take charge of the company's e-commerce platform:

The project's original version is outsourced to a third party. It uses WebForm + nhib.pdf, and the code is unsightly and the Bug is infinite. It often hangs when it is clicked.

At the beginning, I recruited a few intern students to play there. I was confused. Haha...

At that time, the first thought was to redo it. However, you can't guess the boss's mind.

Then the first stage is to maintain the stability of the old project. As long as the problem does not need to be solved by hundreds of servers, it can be handled weakly. After all, there are no three, two, or three servers, it is not easy to mount the girder.

In the second stage, we naturally think about redo:

There is an ASP. NET Aries framework in the e-commerce background, so you don't have to worry too much;

What is the e-commerce front-end framework?

1: WebForm is too conservative;

2:. NET Core is too radical;

3: The QBlog (autumn Garden) has a high threshold;

4: write a new set, the transaction is busy, there is no time to calm down and think, and time is limited, has submitted a plan to the BOSS.

Finally, you can only select ASP. net mvc.

Think about the. NET environment, and the popular development frameworks on the market are all owned by Microsoft ?)

I also know that some older people also build frameworks, however, they are all made for themselves or their own companies (and the angle and breadth of thinking for users are different ).

There are also some that are made to the masses for free, but there will be no sound after three or two promotions;

The garden will never take the initiative to help third-party open-source frameworks for promotion. Relying on the passion and feelings of the bloggers, it is unknown how long the support will last. After all, there is no income to build a framework.

A breeze:

Later, the boss fell down... (tears ~~~).

Then, you have time to calm down and use your feelings to create a framework!

At last, Taurus. MVC came out and was open-source !!! Open source !! Open! Three times.

About the framework name: Taurus

When CYQ. Data was created ten years ago, the name was not good (blame me), leading to high promotion resistance.

So now we have to think about a new framework. After all, we have to get a name like Qi DeLong, Qi dongqiang, and Qi DeLong dongqiang.

The ASP. NET Aries business development framework, which was released just a short time ago, was named Aries (Aries, gentle and emotional ).

So I think it's time to continue the Aries series: Aries. MVC?

Or... What about building the 12th Palace of gold?

Then I checked the English words of the thirteen constellation and the eight major planets and found that they were not satisfied. The name of the jumping star was blocked. Let's name it in sequence.

Taurus (Taurus), in fact, the final decision is the pronunciation of the word: Off (very pretty big feeling, and full of imagination, burst force with a little color mi feeling ).

Applicable scenarios of the framework:

Choosing a framework is a learning option for experts. It is just a choice for beginners.

When I was young, I was forced to select a framework created by Microsoft. Now, I am the Creator:

CYQ. Data + Aries + Taurus can adapt to almost all business scenarios.

ASP. NET WebForm and ASP. net mvc are no longer needed.

However, it is still inseparable from the ASP. NET platform.

As mentioned above:

1: ASP. NET Aries is applicable to rapid development of business systems and backend systems.

2: Taurus. MVC is suitable for front-end systems and webapis such as e-commerce with high performance requirements.

Advantages of the framework:

Generally, the advantage of the framework is that, when B starts to blow off, as long as the market slogan is loud, the product is not a weak B as long as it is not a problem.

What are the advantages of the framework? Most people ask this question first. If you want to blow my heart and heart, you will only reply to you, and then silently download the source code to the hard disk.

Since the market is basically a unified place for Microsoft, it is usually looking for the MVC of Microsoft.

In fact, compared with. net mvc, it can only be said: one heaven, one underground.

After MVC4 is installed: 800 M (I Don't Know What To install );

Taurus. MVC installation: 400 K (Taurus. Core. dll + CYQ. Data ).

Obviously: Microsoft has been doing addition over the years, without thinking about subtraction, innovation, and compatibility. Many products are very careless and make people worry-free.

Let me talk about the advantages. Let me think about it. Let me think about it together...

First, let's use a few abuse words: lightweight? High performance? High efficiency?

No, it must be different. what others do not do is an advantage:

Oh, yes, you have to use a graph to show the Major. Yes, this way, that way, good, complete ,:

Taurus. MVC source code:

1: The Source Code SVN: https://github.com/cyq1162/Taurus.MVC

2: Demo site: http://taurus.cyqdata.com

The Demo is as follows:

Introduction of Taurus. MVC framework:

1: Search for Taurus. MVC on Nuget and reference it (Taurus. Core and CYQ. Data will be introduced)

Then a readme.txt is generated. Configure the URL interception and the dll in the specified Controller as prompted.

2: Use the source code project directly (a Demo will be found in the source code project ).

Taurus. MVC Framework Introduction: 1: solution diagram after source code download:

2: solution description:

1: CYQ. Data: The main XHtmlAction is used as the template engine, and the Data layer can provide Model or automatic binding syntax.

2: Taurus. Core: mainly implements Core methods such as route rewriting, Controller calling, and ViewEngine.

3: Taurus. Controllers method entry, where the code is written.

4: Taurus. View only stores html, css, and js

3: Additional instructions:

1: The Controller, Modle, and View files of MVC are usually put in one project, which is split into two projects.

2: For clear project levels, you can create Model projects (put entities), Logic projects (write business Logic code), and Utility (release tool class ).

3: The Demo provided by the framework is put into the Controllers project.

The following describes the basic principles and usage of MVC:

1: Taurus. MVC route: 1: hidden route:

In. net mvc, routing is a very important but troublesome function.

To simplify MVC, the first step is to think about how to implicitly eliminate routes.

At last, two routes are set internally by default:

1: {Controller}/{Action}/{Para}

2: {Module}/{Controller}/{Action}/{Para}

The first type is used by default.

2: extended route:

When deployed as a sub-application or the first is the user name, an additional prefix directory is displayed.

In this case, the RouteMode value can be set to 2 through deleetting, Which is easy and excessive.

The context provides three parameters for you to obtain information: ControllerType, Action, and Para.

Now, the route is finished. Do you want to customize the route? No Way! Oh, you can change the source code ~~~~

2: Taurus. Controllers1: Search for Controller:

The rule has been set, and the rest is to find the Controller according to the rule.

1: Collect all controllers.

2: specify where to collect: by default, Taurus. Controllers is used to find the inherited base class: Taurus. Core. Controller.

3: Customize the value of Taurus. Controllers for storing Controllers: deleetting configuration. Assume that it is Taurus. View.

4: When the Controller is not found, DefaultController is found. If all the data is available (in the Demo), an exception is thrown.

2: Call the Controller Action:

1: The method names are all public void and there is no parameter (reload multiple parameters, only the first one is collected by default ).

2: For an Ajax request, assign the processed value to the AjaxResult of the context.

3: if the Action cannot be found, the Default method will be found. (This base class contains the Default method, so it must exist. If necessary, rewrite it ).

3: Taurus. View

1: Template: html (strictly speaking, it should be xhtml)

2: Template Loading Method: Addressing path corresponding to the URL: Views/{Controller}/custom action=.html

3: reference the master page: itemref = "Page. node name ". (Itemref is the property of the div. If it is not used, it is used to reference the node for replacement..)

4: Load replacement Syntax:

A: For input tags, you can use CYQ. Data. MDataRow. SetToAll to assign values in batches.

B: For $ {name}, you can use View. LoadData (data, "prefix") to automatically format it.

C: For list loop labels, You can Bind them using the CYQ. Data. MDataTable. Bind method.

Summary:

1: The usage method is not described in detail in this article. For the usage method, we will introduce it in the next article:

Well, an introduction is enough, because there is nothing to talk about and there is no need to write a book.

2: The Demo provides the add, delete, modify, and query list paging function. If the function is good or has the MVC Foundation, it will be used by scanning the source code.

3: Today's focus is on open source... Open source... Open source... The important thing is 123.

Finally, let's say:

The open-source framework gives the people of. NET an option.

If you have feelings, after reading the source code, you should have money to give money and no money to give likes. Haha...

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.