MVC Small Business website instance (2)-Project Architecture

Source: Internet
Author: User

This project is developed using Asp.net MVC 2 + Castle + Entity Framework.

The following describes the project structure:

First of all, I will not talk nonsense about the entire solution.

 

1.
Database: sqlserver2008 is used here

2.
Cache Design: to reduce the pressure on the database, cache the data that does not change in the short term on the page, thus reducing access to the background database. This uses the cache module in the Microsoft Enterprise Library.

3.
MVC Framework Design: MVC is an important architecture of the Web application front-end. Most of the content of website interaction will be concentrated in this part, an efficient and easy-to-expand MVC framework is an important component of the entire website.

The data entity is the data entity generated by Entity Framework:

 

There are many tables, and I do not like Relational Data Operations (it is easy to query and maintain). Therefore, data associations without creating tables seem messy.

Data Access uses the repository mode. Most MVC projects currently use this mode (such as oxite,
). I will introduce it in the next article.

4.
SEO (Search
Engine optimize) solution: Provides website search optimization solutions for search engines.

Here we mainly process the keywords and descriptions of the page.


First define a abstract Controller base class, which defines some websites
SEO fields:

Public abstract class BaseController: Controller, ISiteProvidesBaseService
{
//
// GET:/Base/
Private IBaseControllerService _ baseControllerService;

# Region ISiteProvidesBaseService Member
Public IBaseControllerService BaseControllerService
{
Get
{
Return this. _ baseControllerService;
}
Set
{
_ BaseControllerService = value;

ViewData ["Page_Title"] = _ baseControllerService. ShopName;

ViewData ["Page_Description"] = "\" {0} \ "". With (_ baseControllerService. PageDescription );
}
}
# Endregion

Public String message {set {viewdata ["page_message"] = value ;}}
Public String title {set {viewdata ["page_title"] = value ;}}
Public String keywords {set {viewdata ["page_keywords"] = value ;}}
Public String description {set {viewdata ["page_description"] = value ;}}

Public Virtual void withtitle (string value)
{
Viewdata ["page_title"] = "{0}-{1}". With (viewdata ["page_title"], value );
}

Public Virtual void withdescription (string value)
{
Viewdata ["page_description"] = "{0}-{1}". With (viewdata ["page_description"], value );
}
}
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.