MVC Architure on .Net

P

-pb-

We are developing a Windows client using .NET 2.0 and C#. We have
decided to use MVC based architechture due to its obvious advantages.
This application shows data from database in a Grid. We want to add a
functionality of Printing grid and export grid to XL sheet. I would
like to know where will I have to code above functionalities? Should
it be in view or controller?

Any suggestion is well come.
 
C

Cowboy \(Gregory A. Beamer\)

One option is the Smart Client Factory (watch page wrap here):
http://www.microsoft.com/downloads/...f9-8410-4f13-ad53-05a202fbdb63&DisplayLang=en

You will have to also download a few other things (mentioned on the page) to
get it working. This is actually MVP, I believe, which is a variation of MVC
(Presenter rather than Controller). The factory will guide you on adding new
forms, hooking them together, etc. There is a bit of a learning curve, but
it is fairly easy to add new views.

As for your question, most of the actual code is in underlying libraries and
not in the view or the controller/presenter. You do this so you can slap a
web front end on the application in the future, if management desires. There
are certain pieces of functionality that cannot be encapsulated, but they
are rare.

The general rule for MVC or MVP is this.

1. A view represents a specific form that is shown to a user (page in web
apps)
2. A presenter/controller shows this view at the appropriate time and links
actions back to the libraries that encapsulate functionality of the
application

I think darron schall has a nice explanation, when he states:
http://www.darronschall.com/weblog/archives/000113.cfm

"In MVC, the model stores the data, the view is a representation of that
data, and the controller allows the user to change the data. When the data
is changed, all views are notified of the change and they can update
themselves as necessary (think EventDispatcher)."

It is also has a decent explanation of the difference between MVP and MVC
and why MVP is now the golden child. :)

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 
M

Mr. Arnold

-pb- said:
We are developing a Windows client using .NET 2.0 and C#. We have
decided to use MVC based architechture due to its obvious advantages.
This application shows data from database in a Grid. We want to add a
functionality of Printing grid and export grid to XL sheet. I would
like to know where will I have to code above functionalities? Should
it be in view or controller?

Any suggestion is well come.

That would be in the Bussiness making a call to the Service layer.

The new boy on the block is MVP.

MODEL-VIEW-PRESENTER

http://www.polymorphicpodcast.com/

click 'Shows'

click 'Design Patterns Bootcamp: Model View * Patterns*

view parts 1-5
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top