Translation: Using ASP. NET MVC 4, EF, Knockoutjs and Bootstrap design and development site-1

Source: Internet
Author: User

Original address: http://ddmvc4.codeplex.com/

Original name:Design and Develop a website using ASP. 4, EF, Knockoutjs and Bootstrap

Another MVC application: Introduction

Sites are always growing fast, and once you start growing, the site becomes difficult to develop, organize, and maintain. So when we add functionality or develop projects, the lack of design of large sites will become out of control. The point here is that the architecture of the site must be simple, easy to understand by any designer (from beginner to intermediate developers), and search engines. In this article, I'll try to design a site that supports online maintenance of contact information. In the future, this application may be used in large community sites around the world with added functionality and modules. Therefore, the design of the site must be able to easily adapt to future growth of business logic.

In the first part of the article, I'll use this idea to discuss creating and designing UI UIs that will be separated from the business logic and can be created without relying on any designer/developer. In this section, we will use ASP. NET MVC, Knockout Jquery and Bootstrap. Later in the article, we will discuss the design of the database, and the use of layered structures to implement business logic, using techniques such as SQL Server, Entity Framework, and Castle Windsor to support dependency injection.

Separation of concerns: key objectives

The key is to isolate most or all of the business logic. Logic should not be bound together with the page. What if you re-use logic on another page? This way, we will be able to copy and paste. If we do, the project will become maintainable. Another important point is the separation of data access from the business logic, which is not a problem because we plan to use the entiy Framework, because EF has already done so. We can easily transfer our EF files from one project to another, simply add some necessary references to it, and here is the design diagram.

The final solution is shown in Visual Studio as follows:

There are 7 projects in the solution, is it necessary?

See what you think ... This design brings many advantages, including:

    • Separation of concerns: clear layering means that applications can be separated into separate areas without overlapping functions. UI designers, for example, can focus on their work without having to be influenced by business logic (Application.web). The code developer only has to deal with the main business logic (Application.dto or Application.manager).
    • Productivity: For existing software can easily add functionality, because the structure of the software is already in place, the new function code can be step by step, any complex problems can be easily identified and separated, and achieve the software engineering requirements of quality elements: robustness, adaptation, maintainability, and reusable.
    • Maintainable: Easy-to-maintain applications, clearly defined structures for easy understanding, easy to spot bugs and anomalies, and minimal risk of modifications.
    • Adaptability: new technologies, such as different front-end technologies, or engines that add business logic, are easy to do and your application architecture has a clear separation of concerns.
    • Reusability: Reusability is an important concern for any application design because it lowers TCO, our design takes into account the reuse of WEB applications and different tiers, and later in the article we will discuss the features in each layer in detail.
Tools and Technologies

In order to achieve the final goal, we need the following tools:

    • Visual Studio 2012
    • ASP. NET MVC 4 with Razor View Engine
    • Entity Framework 5.0
    • Castle Windsor for DI
    • SQL Server 2008/2012
    • Knockout.js & JQuery
    • Castle Windsor for DI
    • Bootstrap CSS

Article posted: http://www.cnblogs.com/haogj/

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.