Building a Simple Blog Engine with ASP.NET MVC and LINQ - Part 1
page 2 of 8
by Keyvan Nayyeri
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 54595/ 739

What is MVC?

Yes, what is that?! Others have described this better than me but I repeat it in my words.

Model View Controller (MVC) is a methodology to build an application based on the idea of dividing the implementation into three roles: Model, View and Controller.

Let us take a second look at the above sentence. From the above sentence we believe that MVC is a methodology not a technology, so it has been used before Microsoft adapts it to ASP.NET. I persisted on this because saw some guys who thought it was a technology that is designed for ASP.NET specifically.

I also need to introduce the three roles in a nutshell:

·         Model: This is the role to maintain the state. Usually these are classes that represent data in a database.

·         View: The second role displays the data in the user interface to end users. This may be a set of user interface elements like TextBoxes, editors and buttons.

·         Controller: The last role is responsible to interact with user inputs and handling it. In fact, controller is where you implement the actual logic to handle what the user has asked for.

The MVC has become a very good methodology to design applications that rely on data interactions. The most important benefit of MVC is the ability to unit test the application easily because you can unit test an MVC application via its controllers and apply a TDD workflow (Red-Green-Refactor) easily.

Figure 1 shows the structure of MVC pattern where the model is independent from the controller and view so this enables the testability of the model independently from what controller and view are. On the other hand, there is a separation between model, view and controller that lets developers test their MVC applications easily. In fact, separation of view as the user interface element and controller and model is important because it simplifies the testing process.

Figure 1: MVC structure

I do not discuss more about the MVC and just refer you to Scott Guthrie's post about it and its description on Wikipedia that would be sufficient to get you started.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 1 and 6 and type the answer here:

User Comments

Title: web design   
Name: arnel
Date: 2/19/2010 10:47:15 PM
Comment:
thanks a lot for sharing your information about this features.
Title: sikat ang pinoy   
Name: renanorola
Date: 1/27/2010 8:32:43 PM
Comment:
Found this article interesting. We where debating rolling our own blog engine for our latest website but due to time constraints went with wordpress. . I have to look forward to read more from your site in the future..

Thanks for the information and tips i gain in this site.
Title: renantech   
Name: renanorola
Date: 1/24/2010 7:55:17 PM
Comment:
thanks for the tutorial very informative.
Title: uggboots   
Name: uggboots
Date: 1/10/2010 3:25:28 AM
Comment:
top 1
[url="http://www.uggsretailer.org]ugg boots[/url]
[url="http://www.uggsretailer.org]ugg outlet[/url]
Title: Outsource software developers   
Name: hiralvora
Date: 1/5/2010 1:25:16 AM
Comment:
This post clear my understanding about mvc that its not technology for asp.net but its methodology.
Title: SP   
Name: SP
Date: 12/26/2009 9:22:40 PM
Comment:
SUA EMPRESA PAGA CONTA POR BOLETO BANCÁRIO?

Temos uma solução eficiente, quando estes boletos chegarem atrasados ou estiverem vencidos.

Com o Advanced Boleto você consegue pagar seu BOLETO MESMO VENCIDO:

-> SEM FILAS

Pague seus boletos vencidos pela internet, sem precisar ir ao banco nem esperar para receber outro boleto.

-> SEM MULTAS ABUSIVAS

Diga não aos juros abusivos das cobradoras após o vencimento do boleto. Pague somente o justo contratados nos boletos.


-> VÁRIAS UTILIZAÇÕES

Ajusta o novo fator de vencimento e valor de vários boletos:

- Cartões de crédito
- Parcelas de financiamento
- Parcelas de faculdade
- Boletos de planos de saúde
- Mensalidades escolares
- Boletos de fornecedores e empresas
- Todos os boletos pré e pós impressos de todos os bancos de compensação nacional.


Saiba mais informações e faça o download GRÁTIS do programa demonstrativo em:

http://www.advancedboleto.com
Title: About blog engine   
Name: bins
Date: 11/20/2009 12:58:45 AM
Comment:
very good
Title: First English Article   
Name: zabery
Date: 10/1/2009 9:38:37 AM
Comment:
this is my first english article i have read
Title: Very Good   
Name: Nimesh – Perception System
Date: 8/29/2009 1:39:31 AM
Comment:
Nice Post
Informative and useful one
I am .Net Developer and I am looking for this
Thanks for the great stuff.
Title: about blog   
Name: rem
Date: 11/16/2008 3:41:24 AM
Comment:
nice blog...
Title: about post   
Name: Rem
Date: 11/4/2008 6:10:36 AM
Comment:
Nice post...
Title: BlogService open source blog engine on MVC   
Name: Jarrett
Date: 10/18/2008 5:48:48 PM
Comment:
There is an open source blog engine called BlogSvc over at

http://codeplex.com/blogsvc

Check out the source code.
Title: How...   
Name: AmyJK
Date: 6/5/2008 6:27:20 AM
Comment:
How do i get hold of the extentions?
Title: Part 4   
Name: Keyvan Nayyeri
Date: 5/2/2008 3:01:15 AM
Comment:
You can read the fourth part here:
http://aspalliance.com/1630_Building_a_Simple_Blog_Engine_with_ASPNET_MVC_and_LINQ__Part_4
Title: Part 3   
Name: Keyvan Nayyeri
Date: 3/5/2008 1:35:04 PM
Comment:
You can read the second part here:
http://aspalliance.com/1604_Building_a_Simple_Blog_Engine_with_ASPNET_MVC_and_LINQ__Part_3
Title: Part 2   
Name: Keyvan Nayyeri
Date: 3/5/2008 1:34:21 PM
Comment:
You can read the second part here:
http://aspalliance.com/1559_Building_a_Simple_Blog_Engine_with_ASPNET_MVC_and_LINQ__Part_2
Title: Download   
Name: Alexandre
Date: 3/3/2008 3:09:17 PM
Comment:
How may i download it?

[]s
Title: Great starter kit   
Name: dotservant.com website hosting services
Date: 2/21/2008 3:26:26 AM
Comment:
Great introduction to MVC and a simple hands on exercise for a quick run through of the general concept of ASP.NET MVC.
Title: Comment on Figure 1   
Name: Keyvan Nayyeri
Date: 2/4/2008 12:59:35 PM
Comment:
Dave,

Thank you for leaving your comment. If I can remember it correctly, I took Figure 1 from MSDN. Yes, there can be a two-way connection between controller and view but don't forget that this isn't mandatory. There may be some cases where controller gets data from view to perform an update but this isn't 100% a case for all scnearios.

I hope this makes sense.
Title: Figure 1 (MVC structure) is incorrect   
Name: Dave
Date: 2/4/2008 12:40:04 PM
Comment:
The view NEVER(!) updates the model. The controller is responsible for loading and saving states to the model layer. Loaded information from the models layer is than passed the the view. The view does only presentation. By definition it is impossible that a presentation contacts the models view or even updates it. The controller is responsible for all logic needed to view, create, update or delete a page.

(I hope my schema stays correct)
+------------+ +-------+
| controller | --- loading information --> | model |
| | <-- saving information ---- | |
+------------+ +-------+
|
V
+------------+
| view |
+------------+

(Basicly your have to define a two-way (loading and saving) connection from the controller to the model. The controller has a 'write-only' connection with the view.

The rest of the article is written very well. Keep up the good work!
Title: Great   
Name: Santosh
Date: 1/29/2008 1:16:45 PM
Comment:
Nice article, easy to undestand!
Title: Nice   
Name: Gustavo
Date: 1/24/2008 1:45:58 PM
Comment:
Keep Going...
I want to see the final result soon! =]

Product Spotlight
Product Spotlight 






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2010 ASPAlliance.com  |  Page Processed at 3/21/2010 12:52:39 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search