Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
(Re)Assessing Best Practices

As we progress as developers, we strive to seek out the "best" way to perform our craft. The chosen methods to attain this lofty goal always bring with them a number of developmental trade-offs. Some techniques may simplify the code but lessen fine grained control while others enable greater power while introducing complexity. Model-View-Presenter with ASP.NET is a wonderful example of the latter. MVP aims to facilitate test-driven development of ASP.NET applications with the unfortunate introduction of added complexity. So while developers will be more confient in the quality of their product, MVP hinders their ability to easily maintain code. Yes, the tests will (hopefully) inform the developer that a bug has been introduced, but the inherent complexity of MVP makes it difficult for later team members to become comfortable with the code base and maintain it as project development continues.

Fortunately, as time progresses quickly in our field, resources and tools become available which enhance our ability to write powerful applications while simplifying the coding process itself. The introduction of NHibernate, for example, eliminated vast amounts of data-access code while still providing powerful facilities for managing transactions and dynamically querying data. Castle MonoRail (and Microsoft's upcoming spin-off of this framework) now does for writing testable and maintainable .NET web applications what NHibernate (and the upcoming LINQ to Entities) did for ADO.NET. This is not to say that the previous techniques were necessarily wrong, but that they were only applicable considering the developer's toolset that was available at the time of selection.

In adapting to the evolution of our field, it is important for developers to note when an accepted technique is no longer valuable in light of current alternatives. Specifically to this example, MVP was a very powerful technique for writing ground-up, test-driven ASP.NET applications but is no longer a strong candidate for consideration when compared to the time saving benefits and simplicity of Castle MonoRail and Microsoft's upcoming MVC framework. Oddly, it is sometimes difficult to "give up" on something that worked perfectly fine before, but that's the nature of our business...one tenet that's not likely to change anytime soon.

Billy McCafferty


Posted 10-15-2007 12:47 PM by Billy McCafferty

[Advertisement]

Comments

Sean Chambers wrote re: (Re)Assessing Best Practices
on 10-15-2007 4:05 PM

Bill,

You hit the nail on the head yet again. I completely agree with your points above.

One thing I would have liked to see was more examples of MVP scenarios when I was first starting with it.

Another thing that would really benefit the community is more examples of mapping with NHibernate. This seems to be one area that alot of people still have trouble with.

All around though, the applications I create now are so much more flexible and able to deal with change at the cost of complexity. Although, the complexity is worth it and can easily be explained to a fellow developer to get him on the right track.

Great post!

Pete wrote re: (Re)Assessing Best Practices
on 10-15-2007 4:36 PM

I agree with you that the ability to adapt quickly is a KEY factor in our game. I assume that by the time I master a certain technology, there is better one in the works to replace it within 6 months or so...

Tangent:

Speaking of new technology, one thing I am not completely sold on yet: using LINQ as an ORM. I built a comparison project between LINQ and NHibernate on top of a common database schema. I tested multiplicity, many to many, and inheritance scenarios. I was trying to employ LINQ in an active-record style manner and I found the experience much like pounding the square peg in the round hole.

Perhaps I am too set in my ways, but Im still having trouble finding a good usage scenario for LINQ to sql as of yet.

DotNetKicks.com wrote (Re)Assessing Best Practices
on 10-15-2007 4:37 PM

You've been kicked (a good thing) - Trackback from DotNetKicks.com

Mort wrote re: (Re)Assessing Best Practices
on 10-15-2007 8:25 PM

I don't think NHibernate and Monorail have been built on large enterprise systems.

To me, it still only is relevant in smaller business applications, hobbyist websites, etc...

But, MVC is as a pattern that should be available to any programming language (OO language I should say).

Billy McCafferty wrote re: (Re)Assessing Best Practices
on 10-15-2007 11:16 PM

Hey Mort! ;)  From experience, I can VERY confidentally say that NHibernate is fully capable of handling large enterprise systems.  (Due to a non-disclosure agreement, I can't get more specific than that.)  As for MonoRail, I can't say from experience that it's able to handle large enterprise systems...but I'll report back in a couple of years to let you know my opinion!

Jericho wrote re: (Re)Assessing Best Practices
on 10-17-2007 8:32 AM

This is only evolution like biological evolution  of ways to create good, predictable, and less fragile software. I think 10 or 15 years ago not as many people as now thought about IOC MVC in their applications.

We can't stop evolution, even big companies like MS influenced by IT evolution. So better late than never MS decided to do something important in their way which will be very important for all ASP.NET community. I think they are on the beam and wish them good luck!

anortham wrote re: (Re)Assessing Best Practices
on 10-19-2007 12:13 PM

RE:  NHibernate and Enterprise

I know it works, I'm sitting here looking at it.

Toby wrote re: (Re)Assessing Best Practices
on 11-14-2007 11:09 AM

Billy - what does the Tag "Remenissions" mean in this context?  Google only reports that it's the title of a song by Avenged Sevenfold... :)

[ perhaps Ruminations? ]

Billy McCafferty wrote re: (Re)Assessing Best Practices
on 11-14-2007 11:52 AM

Heh!  That's funny...yes, ruminations is what I meant.  I've changed it to DeepThoughtsByJackHandey to eschew any further confusion. ;)

social bookmarking service wrote re: (Re)Assessing Best Practices
on 03-23-2013 11:38 PM

LfGK2G Im obliged for the blog post.Much thanks again. Really Cool.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)