On Tue, May 19, 2009 at 8:41 PM, Nathan Andelin <nandelin@xxxxxxxxx> wrote:

From: Steve Richter
I am learning ASP.NET MVC and am finding it incredibly well done.

It struck me how much an MVC project is patterned after Ruby on Rails, which seems to be Microsoft's modus operandi - to take concepts and
designs from original innovators which have gained traction, and incorporate them into their products - adding intellisense, wizards, and other
value-adds to nudge original innovators off the playing field.

Scott Guthrie is a programmer for MSFT. He runs the ASP.NET division
of the company. Word is that he sketched out MVC on a plane trip.
http://www.devx.com/codemag/Article/37184/1763

MVC is not very complex. Basically a set of standards for organizing
the code of your website. I think what makes ASP.NET MVC so good is
the soundness and innovation which is C# and the .NET framework.

For example, there is the "yield break" and "yield return" statements.
Using these statements you can write a method that will be called
repeatedly by a 'foreach" type statement. The method is coded in a
straightforward manner, with "yield return" statements where you might
normally see a 'return". Only the compiler puts in place the code
needed to resume execution each time the method is called at the
statement that follows the last "yield return". Combine with the
IEnumerable interface and you have something that is very useful.

Here is a method that can be called from a foreach loop to return all
the current data entry errors:

public IEnumerable<RuleViolation> GetRuleViolations()
{
if (String.IsNullOrEmpty(Title))
yield return new RuleViolation("Title required", "Title");

if (String.IsNullOrEmpty(Description))
yield return new RuleViolation("Description required", "Description");

if (String.IsNullOrEmpty(HostedBy))
yield return new RuleViolation("HostedBy required", "HostedBy");

if (String.IsNullOrEmpty(Address))
yield return new RuleViolation("Address required", "Address");

if (String.IsNullOrEmpty(Country))
yield return new RuleViolation("Country required", "Country");

if (String.IsNullOrEmpty(ContactPhone))
yield return new RuleViolation("ContactPhone required", "ContactPhone");

bool rv = PhoneValidator.IsValidNumber(ContactPhone, Country);
if (rv == false)
yield return new RuleViolation("Phone# does not match
country", "ContactPhone");

yield break;
}


Does MVC pose a mixed message to developers - an identity crisis?  Will the real asp.net stand
up - Drag & Drop Webforms or MVC?

Nathan, you might find this discusion interesting. The guest does not
appear untile the 7 minute mark. There is a lot of talk of Java and
.NET.

http://www.dotnetrocks.com/default.aspx?showNum=444

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.