Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 19, 2007 07:03 PM by abombss
Dec 17, 2007 02:07 PM|LINK
We are planning to re-develope our star product from Power Builder to ASP.NET 2.0.
While doing some R&D on Dot Net technology, I could see lot of Posts on the MVC Architecture.
FYI: This is quite a big application and has taken 60 man years.
Using ASP.Net technology, it is estimated that the first release will take at least 20 man years work.
The basic architecture, we have designed is as follows :
1. Presentation Layer - Aspx pages using ObjectDataSource, GridView, Formview and Third Party controls likes Infragistic (Customer.aspx)
2. BLL - Business Logic Layer (Customer.vb - All the business Logic is written here)
3. DAL - Data Access Layer (DAL.Vb -> Interact with the Database)
After reading a bit about MVC architecture, we are quite attracted, since it is written at various places that MVC is one of the best architecture for the enterprise level applications. But, I could not really see a good sample project, which can really
guide us that how to implement this.
May be, my point of view is wrong, since I am quite new to the MVC architecture but, I have seen few example and my feeling is that instead of making the development simple, it is making more complex. Things, which can be done in a simpler way, it involves
number of classes, functions and calls to the controller, view etc. and finally display the data to the presentation layer.
I will apperciate, if someone can provide a sample project, which can make us understand the advantages about the implementation of the MVC architecture using ASP.NET.
I am looking for a simple project, where a simple page attached to a simple table say 'CUSTOMER' and doing all the operations like Add, Delete, Edit, Save etc.
Thanks in Advance,
Dec 17, 2007 02:24 PM|LINK
First, this is off-topic, but for an application that is going to take 20 man-years to build, I sincerely hope that you plan a little bit more than Presentation -> BLL -> DAL. I'd also recommend frequent releases in an agile fashion to make sure the project
is a success, but that is conversation for another day.
About MVC, it is a perfect fit for a large system like you are describing. You have so much more control in testing and you don't have to wrestle any viewstate or complex page lifecycle issues that you might see people posting here about.
There is a reference application currently under construction in MVCContrib (http://www.codeplex.com/mvccontrib) so check that out and get a feel for it.
Dec 17, 2007 02:38 PM|LINK
the real benefit with MVC is the separation you will be able to achieve between your views and your application. You can build a very functional and testable application ensuring all business requirements are met outside of the presentation where it is
much more difficult to test.
As for sample apps, MVC is very new. The first CTP came out about a week ago somost of what you will see are small demos and bits of functionality.
Have a look at some of the monorail samples as the architecture is very similar to MS MVC. Many things are different but it should at least give you an idea of how the controllers, views, and models work.
Dec 17, 2007 02:42 PM|LINK
Thanks for your suggestions BEN!!
We have already decided to release the developments using agile approach to have more control over the development and the success of the project. Since, we have number of customers and they agree to perform the testing on the small releases and give us
the feedback parallely.
Now, about the sample you have provided, I could not see the working sample over there.
Another thing, I want to highlight is, I am looking for a simple project explaining the MVC architecture not the complex one.
Dec 17, 2007 02:46 PM|LINK
Check out Monorail as there are more samples out there for that platform. The concepts are almost identical, so they transfer over easily.
Have you checked out ScottGu's detailed posts on the topic? That's the best intro you could ever ask to get :)
Dec 17, 2007 03:53 PM|LINK
I have tried a lot to find out ScottGu's detailed posts with the sample project, but could not find appropriate one.
If possible, please send me few links of his posts or any other links which can explain my requirements.
Dec 17, 2007 05:52 PM|LINK
Dec 17, 2007 07:52 PM|LINK
Hi Ben & all Techies,
Thanks for providing the good links to know about the MVC architecture.
I need an expert advice on this that whether I should use MVC architecture or not in my enterprise level application development.
As I could see that the time required for the development using MVC architecture would be at least double than using the traditional n-tier architecture .
What I saw on the sample application / example provided by scottgu is : he has written lot of code for simply displaying product, adding and editing.
Where If I see my code for the simple add, edit, delete and save operations code then it is quite less as compared to the scottgu example.
Since, my design contains Presentation Layer, BLL & DAL and itself is the seperation of the layers then why should I use MVC architecutre. I am still unable to figure out the benefit of the MVC architecture over the traditional n-tier architecture having
presentation, BLL and DAL sepearted from each other.
Please suggest, if my point of view on MVC architecture is different or say wrong.
Dec 17, 2007 08:14 PM|LINK
I may be going out on limb here, but I am guessing you have lots of code in the code-behind of your regular aspx pages?
If you do, how are you testing that?
How are you sure you do not have business logic leaking in code behind?
Simple scenarios like coloring a table row if a value is negative is pretty complicated and can only be done in code-behind. In mvc things like this are very trivial. I don't want to write code for presentation, I want to write views and templates.
Lines of Code, to me is one of the worst metrics for assessing if a technology or platform is the right one or not. Just because its less code does not mean its easier to maintain or extend. If you are happy with webforms stick with that.
I haven't used webforms by choice in over 18 months because I found them to just be too difficult to work with. I found myself always fighting the framework to make things I wanted to work.
I also wanted real lightweight ajax without dealing with postback and full page renders, etc.
Again, back to testability, I also struggled with testing my webform code, and over time I always started to leak things into my code behind that should not be there. MVC is the right approach for me.
Obviously loc is a factor but testability, maintainability, solubility, loose coupling, are more important in my book and I have found MVC frameworks much better at achieving those goals than webforms.
With tools like ReSharper I worry less and less about lines of code as I can have templates, snippets, and total control over refactoring.
Just my .02
Dec 17, 2007 09:55 PM|LINK
I concur with Adam's sentiments.
My only addition would be that the biggest time drain in development is not typing, it's time in the debugger, Especially when you have to debug a code-behind file. You have to fire up the asp,net runtime, click to the page / method you want to tests.
With a fully tested Controller you will spend much less time in the debugger. When you do need to debug, you set your breakpoint in the test and it will load up much faster and right to the method in question.