|
Hopefully this doesn't count as a coding question. My boss pinged me today about considering the move from asp.net to mvc because it's supposed to be better for n-tier database and performs better then asp.net web forms.
I have absolutely no experience with or knowledge of mvc, so I thought I'd see if there was a general consensus in terms of whether or not it's a better architecture to do database intense web development with.
What are your thoughts?
|
|
|
|
|
It only affects your front-end. The rest of your n-tiers are still C# and SQL.
Go with your department's expertise.
Edit: unless you need to get your resume up to date... then go with the mvc so you can match more keywords on the bot searches.
|
|
|
|
|
1.Full separation of concerns with Model - View and Controller.
100% Unit Testable.
2. Light weight because there's no huge View State unlike Webforms.
3. You can have different set of views say for mobile, desktops and render them accordingly. Here comes the re-usability.
And a lot.
Thanks,
Ranjan.D
|
|
|
|
|
Those are actually some very good points...
However, I will say unit testing is not 100% of the code base out of the box, you can't really unit test the DB without affecting its state. You can't test the views without some form of automation.
|
|
|
|
|
Pualee wrote: you can't really unit test the DB without affecting its state That's what mocks are for.
|
|
|
|
|
Pete O'Hanlon wrote: That's what mocks Moqs are for. FTFY
/ravi
|
|
|
|
|
Right, we use mocks (moq), but then that is not really executing all the db level stuff in the business layer, just verifying that the calls are actually made...
|
|
|
|
|
This is how i test my database structure:
http://effort.codeplex.com/[^]
Quote: Effort is a powerful tool that enables a convenient way to create automated tests for Entity Framework based applications.
It is basically an ADO.NET provider that executes all the data operations on a lightweight in-process main memory database instead of a traditional external database. It provides some intuitive helper methods too that make really easy to use this provider with existing ObjectContext or DbContext classes. A simple addition to existing code might be enough to create data driven tests that can run without the presence of the external database.
Eric
|
|
|
|
|
Pualee wrote: However, I will say unit testing is not 100% of the code base out of the box,
you can't really unit test the DB without affecting its state
So don't try to avoid it - just do it.
Presumably the comment is based on an idealistic view of what "unit" testing means? Myself I want my code to work so I make compromises to make sure I can test all of it in a repeatable way.
|
|
|
|
|
We are in the process in making the change from Silverlight to MVC and the differences are huge, mainly because I don't have any real depth in aspx/javascript. If you already have these skills I imagine the transition should be reasonably simple.
I am continually astonished at the number of different tools needed to achieve a high level of interaction that is automatic with xaml binding.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I would think that moving from Silverlight, which is a more Flash-like and rich media oriented creature, to the more html oriented world of asp.net or mvc would be challenging on any numbe of levels.
I really miss native development. I can't believe that in two decades, the best we've been able to do with a global TCP/IP network is application development housed in an amped up document reader. The web browser was never intended to be a serious development environment.
|
|
|
|
|
Why?
I look at the browser as a portal. Nothing but a window to interact with something else.
The good, is no matter what "window" (browser) and what "house" (OS/equipment) you have, you will interact with the same thing.
The bad. The "window" builder sometimes mess up and the view you get from it get's distorted and sometimes unuseable.
|
|
|
|
|
Considering the power of native client development, the Windows API, the stateless nature of html (and the workarounds that have emerged to compensate), etc., it's a very, very weak environment.
Html was developed as a markup and linking language, i.e. a way to display a document and link to the next one. Hacking an environment so that it pretends to be somthing that it's not isn't my idea of a robust development platform.
Of course, for those who live only in the web world, I realize this is a bit of a religious issue in and of itself.
|
|
|
|
|
Mycroft Holmes wrote: I am continually astonished at the number of different tools needed to achieve a
high level of interaction that is automatic with xaml binding.
I couldn't agree more; my company is in the same boat as yours. I'd kill for a simple {Binding Model.Property}.
|
|
|
|
|
knockout.js library does that for plain old html.
|
|
|
|
|
Thanks; I'll have to check it out.
|
|
|
|
|
My post from previous forum message:
On to an issue whether or not we should move to MVC development I have been debating this with my developers now for months.
And some insist MVC is better though I just dont see it.
What makes a programming methodology better for me ?
Speed of development.
Developer spending less time on interface and normal features and more time getting validation and business logic to be solid
Code that is easy to understand by new developers taking on the project
Structure that is easy to follow and you dont have to jump between mappings and target pages to check how they link
Ability to create reusable controls
Visual designer , so you dont have to repeatedly code something as mundane as a table.
Scalability
When working with MVC4
Razor
Visual designer Gone ;(
No Server Controls
Hooking up an event is manually coded (instead of double clicking or hooking up an event
Single controller multiple pages
Bottom line is what is quicker , on asp.net I can drag a button on the exact spot i need it double click (3 seconds later) I have a button named and hooked up to an event without touching the keyboard. which the mvc guy is still busy typing his input tag , not to mention switching between the controller and the markup screens creating a event and a model.
When i used a aspx grid , I get a nice linq data source hook it up to a grid, columns gets auto generated , meaning all i have to do is change the column headers , click that I want to enable sorting and paging , and I am done 2 minutes later. and if I have not too complex columns the add edit and delete features are created for me in one shot which can be configured for more complex scenarios's
Now as an mvc developer doing the whole grid thing , everything has to be coded , I have to code my data queries (be it LINQ or SQL) to do the paging and sorting , 2 hours an insane amount of typing and script later I have something that kinda does the same thing but looks butt ugly. I guess an expereinced MVC dev can do it in probably 10 mintes flat
My Recommendation, MVC is ok for cases with little complexity and smaller size projects, but when you need to deliver something of great scale and complexity you are shooting yourself in the foot as you will still be coding interface logic when a asp.net dev is long done with the project.
Also just in case you wondering I know
1 MVC does not have viewstate : good practiice minimises viewstate/ you can also hide your viewstate in session using very basic code, also viewstate has never kept me awake one night , projects running late has
2. MVC generates easy to read markup : not really relevant since your customers only really look at the interface not the code
("but but but. . . search engines" - trust me google can handle it.
3. Ability to create clean user friendly urls - The url rewrite method has been available since .net 2, and is infinitely flexible to anyone who knows their regular expressions
The goal of industry here is.
1.to have it done quickly
2.have it done at low cost
3.and to have to have it done right
(you can have only 2 of the 3)
now needless to say 3 quality is non negotiable and 2 is usually what sells software to a client .
but 1 does not help you if developers pulling a salary takes 3 months to develop software that brings in 1 month of profit
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
Damn I missed the original thread, I would have been interested in this 3 months ago. We have a senior dev trying to put together a framework using Kendo, the usual, grid, navigation, dialog, and a bunch of standards. All of which we have nailed using Silverlight and it seem a huge amount of coding to get even a klunky UI together.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
once you get the hang of mvc with kendo - you'll never look back.
Kendo makes things so simple it's not funny.....
|
|
|
|
|
That's what my senior dev keeps reiterating, and then starts talking about knockout, json, boostrap, css and other (to me) esoteric stuff.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
learn mvc and don't worry about knockout or bootstrap for now.
json is just a way of formatting payloads on the wire - don't sweat it - it's lean and mean as opposed to xml - that's all.
css is what it is ... you want to use it in your presentation layer if you plan on using html
in other words - learn to walk before you run. there are plenty of free online tutorials (MS has one, Pluralsight, etc...).
I guarantee you - once the lightbulb goes off you'll be asking yourself "it can't be this easy..."
|
|
|
|
|
Rene Pilon wrote: once the lightbulb goes off you'll be asking yourself "it can't be this easy..."
To be honest I felt the same way about xaml binding and MVVM, what a struggle that was coming from a winforms environment. Now we have a "framework" with all the bits required to pull together a LOB app very quickly and we have to go back to square one again with MVC
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
My thread is more recent than 3 months ago , but yes , with MVC you are going to put allot of time into code that in asp.net is a simple property (for example paging)
Good news however in MVC4 your can already put asp.net server controls in which helps a lot. but the pattern still kinda screws you when it comes to hooking up events.
Thats why MVC for me is a nice try but not there yet
Same reason why i didn't use silverlight until it matured
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
Chona1171 wrote: What makes a programming methodology better for me ?
Speed of development. I have a cricket bat that could cure you of that opinion.
The best methodology is the one that best provides the user with what he needs.
Never forget:
-- You do not pay yourself your salary.
-- Your manager does not pay your salary.
-- His manager does not pay your salary.
-- The tossers in HR do not pay your salary.
-- The marketing department does not pay your salary.
-- Architects, COOs, CEOs, and everyone else who works for your company do not pay your salary.
It's the guy who buys your product who pays your salary, so no-one else's opinions or needs matter worth a damn, including yours.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I'll step in and catch the cricket ball for him. It's okay. I'm wearing protective gear.
This is a highly idealistic, and thus often unrealistic, view of the world. Yes, ultimately the money in the payroll account comes from the guy on the streets who buys your product. If, of course, you're in the business of selling software. There is a huge amount of software development for companies who offer products and services which have nothing to do with software, but still depend on internal systems to keep the wheels turning.
Mark_Wallace wrote: The best methodology is the one that best provides the user with what he needs.
I would love it if this were true. However, in the world of business and commerce, it's not. The best methodology is one that delivers the functionality required to keep your company profitable, and does so fast enough to be effective. It doesn't matter how cool your app is if it never ships.
If the CEO takes your company down a path that prioritizes time to market over the way you'd like to do things and you resist, you're out of a job.
Your manager does not pay your salary out of his pocket. However, he gets to choose whether or not you can continue to stick around and keep receiving it. Alienate him by digging your heels in over unrealistic expectations, and you're out of a job.
The marketing department is responsible for the money in the payroll account. If you don't give them what they need to move the merchandise, you still have a job. You just don't have any money in the payroll account.
If you want to make a living as a professional software developer, the best methodology is the one that meets the needs of your company, not the one that adhere to your personal religion of software development. The company writes your check. Fail to meet its needs, and that will end. Abruptly.
You've been around a long time, man. You know that the way the world works isn't always the way it should work. Give the guy a break, and save the cricket balls for your next company picnic.
|
|
|
|