Archive for August, 2008

August 29th, 2008

ASP.NET MVC Preview Release 5

Looks like the MVC team has put out preview release 5 of the MVC Framework today.  You can get the latest version from CodePlex.

Here is what I can tell has changed from the release notes.

What’s New

  • Added global registration of view engines
  • Changed the IViewEngine interface to add the RenderParial method
  • Added support for rendering partial views
  • Added a parameter to specify a default option label for DropDownList controls
  • Moved ASP.NET AJAX extension methods to a separate namespace
  • Added helpers for RadioButton and TextArea controls and made overall improvements to other helpers.
  • Removed helper method overloads to avoid ambiguity
  • Added array support for action method parameters
  • Removed the ActionMethod property from action filter context objects
  • Added support for custom model binders
  • Added an IActionInvoker interface
  • Added an UpdateMode method to the Controller class
  • Changed HandleErrorAttribute so that it does not handle exceptions when HttpContext.IsCustomErrorEnabled is false
  • Added a new AcceptVerbs attribute
  • Added a new ActionName attribute

Known Issues and Breaking Changes

  • Controller class now is derived from ControllerBase class
  • Controller.Execute as removed, it is not called ExecuteCore.
  • Controller initialization steps should be done in Initialize method now.
  • IViewEngine interface is now responsible for finding views, not rendering them.
  • Some overloads to some helper methods have been removed.
  • AJAX helper methods have been moved to a new namespace.
  • This version is incompatible with Visual Studio 2008 SP1 Beta

Upgrading from Preview 4 to Preview 5

  • System.Web.Abstractions and System.Web.Routing have been changed to version 3.5.0.0
  • Assemblies are located at %ProgramFiles%\Microsoft ASP.NET\ASP.NET MVC CodePlex Preview 5

Derik also noticed that many of the classes are still sealed, and is requesting that the team un-seals all classes, and I agree with him.

Breaking and mysterious changes that I have submitted a bug request for:

Update (2008-8-31): Also Derik found a replacement for RenderUserControl, very minor change, but it is the difference between a error and having the thing work.

Tags: ,

Posted in News | kick it on DotNetKicks.com | Bookmark | View blog reactions | 3 Comments »

August 27th, 2008

So I received an iPhone last week…

I have to preface what I am about to say with a couple of things:

  • I have a first generation iPhone
  • I do not have AT&T or any other GSM network
  • I am using this iPhone as a phone mostly as an iPod
  • I use Verizon Wireless as my cell phone provider

I have to say I am pretty impressed with the iPhone interface.  Alot of work has been done with the user interface and making the applications very useable.  But I have noticed the following problems, that wouldn’t nessisary keep me away from this as a phone, but would make me think twice about how usable it is from my point of view:

  • Microsoft Exchange support has been severely dumbed down, and forced in to the limited Apple model surround Mail, Calendar, and Contacts.
    • There are no categories for the Mail, Calendar, or Contacts.
    • There is no way to retrieve my tasks.
    • I use color coded calendar events for separation between Personal, IdeaPipe, and my Employer Voveo.  I have not been able to figure out the color coding that Apple seems to indicate on their Enterprise site.
  • No way to store and access files on the file system.  Which I use when I need a quick thumb drive in a pinch or to carry around presentations.
  • No Copy and Paste
  • Safari crashes under large downloads.  Especially on large pages that are not loaded via AJAX.  So it seems like buffering or rendering of complex web pages seems to be a problem.
  • No Flash or Java support on the “real web.”
  • Unable to make quick edits to Word, Excel, or PowerPoint documents, like I can do on a Windows Mobile device.
  • It is very hard to develop a native application for the iPhone if you don’t have a Mac.  (sort of expected this one though)
  • No voice command software to read calendar events, dial phone numbers, or call somebody out of your contact list.  (not that I need the last two in my current situation)
  • No supported way to tether the iPhone to your computer to use it as a modem.
  • As well as the numerous 3G problems that seem to occur because of an immature 3G network.
  • Security is a second thought behind neat usability features.

The iPhone is a wonderful device, but in my oppinion it is still on the level of a toy, because it is generations behind Windows Mobile and Black Berry with features that are needed and wanted as an average business user. And at least Window Mobile and Black Berry keeps their devices locked and passcode protected, which is another reason Enterprises were probably wise to wait on rolling the iPhone out. Apple’s Exchange integration also seems sort of half assed, and they should have probably spent more time on providing some of the more basic features such as categories and tasks instead of creating a horribly buggy semi-quazi competitor with their MobileMe service.

All in all there is no complelling reason to move away from Verizon Wireless at this time for me.

Tags: , ,

Posted in Review | kick it on DotNetKicks.com | Bookmark | View blog reactions | No Comments »

August 25th, 2008

Deadlocked!: “read committed snapshot” Explained

I just recently read Jeff Atwood’s Deadlocked! article. I just wanted to give some more insight in to the read committed snapshot so that it is not perceived as “magic”. It has some definite advantages when dealing with deadlocks, however if your code relies on row level locking you are not going to be able to use this type of reading in SQL Server.

First lets talk about how you enable it. It is not a transactional isolation level, so if you set it, it will effect your whole database. You have been warned!

alter database [YourDatebaseHere]
set read_committed_snapshot on
go

Basically what this does is create a snapshot or read-only database of your current results that is separate from your live database. So when you run a SELECT statement, to read your data, you are reading from a read-only copy of your database. When you change your database, it happens on the live database, and then a new copy or snapshot is created for reading against.

Personally I am using it on IdeaPipe, because like most Web 2.0 applications there are a heavy amount of reads and very few updates that effect the row. So chances are if you have a website this will decrease your number of deadlocks. But make sure to test thoroughly before implementing read committed snapshot.

When I was doing my initial research a while ago I found this article talking about how snapshot isolation can bite you where it hurts.

For example, suppose READ COMMITTED SNAPSHOT is not enabled in the database and you want to assign one more ticket to a person, but only if that user does not already have high priority tickets:

BEGIN TRANSACTION
UPDATE Tickets SET AssignedTo = 6 WHERE TicketId = 1
AND NOT EXISTS(SELECT 1 FROM Tickets WHERE AssignedTo = 6 AND Priority='High')
--- do not commit yet

Note that you have not explicitly specified an isolation level, so your transaction runs under the default READ COMMITTED level. If another connection issues a similar update:

UPDATE Tickets SET AssignedTo = 6 WHERE TicketId = 2
AND NOT EXISTS(SELECT 1 FROM Tickets WHERE AssignedTo = 6 AND Priority='High')

it will hang in a lock waiting state. Once you commit your first transaction the second one will complete, but it will not assign ticket 2 to user 6, which is the correct behavior as designed.

However if read committed snapshot is enabled on the database the user will end up with two high priority tickets, because the first read happens against a snapshot and the update happens against the live database. So this will obviously cause problems for specifications and business rules that rely on row level locking. So be careful, and make sure you specifically know what is happening with your code before turning this on

Note: Chances are if you are using LINQ you don’t have to worry about the above scenario, however I am not a DBA expert, only a student of the practice. So take what I say with a grain of salt.

Tags: , , ,

Posted in How To | kick it on DotNetKicks.com | Bookmark | View blog reactions | 2 Comments »

August 14th, 2008

Is Stackoverflow.com really a Web 2.0 site?

I have been lucky enough to be one of the few and many people that have had the chance to preview the beta of stackoverflow.com. It has a very nice look and feel in my opinion and seems to work very well for an early beta. Jeff Atwood deserves major kudos. However I have had one plaguing question?

Is stackoverflow.com really a Web 2.0 site?

I started thinking about this question a couple days ago, because as many of you know I have my own project, that isn’t much different functionality wise than stack overflow. As I started cataloging everything that a Web 2.0 site is suppose to consist of, the more I asked the question what is a Web 2.0 site, and is stackoverflow.com really one?

Tim O’Reilly defines Web 2.0 as the following:

Web 2.0 is the business revolution in the computer industry caused by the move to the Internet as platform, and an attempt to understand the rules for success on that new platform.

In my opinion a platform has the following characteristics and so does a Web 2.0.  There are probably many more, but these are the top 4.

  1. It must have a fluent interface.  (this is usually implemented through AJAX)
  2. It must have an externally available API.  (because a closed platform is what Web 1.0 was all about)
  3. Users can own data and have control over who sees it.
  4. It is an obvious advancement from the previous Web 1.0 version of the software if one exisited.

http://stackoverflow.com

Just as a precursor to the following discussion, I have never heard Jeff proclaim that stack overflow is a Web 2.0 site, so this is just my ramblings.  Jeff has also done an awesome job with the site in a short period of time so everything I am saying now will probably change in the future.

Stackoverflow.com has only really done #1 of the first 3.  However what I really want to have a discussion on is if it really has advanced it self enough beyond the old forum model to really be considered 2.0 worthy or is it just a display layer on the 1.0.  For all intents and purposes we are going to use the forums on ASP.NET for comparison.

  • Allows users to create posts? (both yes)
  • Allows users to create reply to the posts? (both yes)
  • Allows users to talk to each other? (asp.net only)
  • Allows users to rank posts? (both yes, but different mechanisms)
  • Allows users to rank replies to posts? (stackoverflow.com only)
  • Allows users to get a system ranking against other users? (both yes)
  • Allows users to tag posts? (both yes)
  • Allows users to tag replies? (asp.net only)
  • Allows users to mark a reply as an answer? (both yes)
  • Allows categorization of posts? (asp.net only)
  • Users aquire badges of honor in the system? (both yes)
  • Users can have a profile of themself and their activity? (both yes)
  • Can easily follow a posting? (asp.net only)
  • Can easily follow a grouping of posts? (asp.net only)
  • Allow users to delete posts? (stackoverflow.com only)
  • Allow users to delete replies? (stackoverflow.com only)

Using the above questions it makes stackoverflow.com look like it is playing catch up to the asp.net forums, which has had a 6 year head start.  But it still begs to ask the question is the technology and application of it worth of the title 2.0 or just 1.1?  I think Jeff needs to impliment the following beyond the typical forum to really claim that 2.0 title.

  • An external API (REST seems popular)
  • Become less of a destination and more of a service:
    • Render in other platforms. (Facebook and/or Open Social)
    • Allow posting and following via SMS and IM.
  • Allow users to follow certain tags, categorizations, users, etc. through RSS, JSON, XML, etc.

I do beleive that Jeff has a long way to go before stack overflow is considered an advancement beyond the standard forum, but if anybody can make that leap it is Jeff.

Tags: , , ,

Posted in Review | kick it on DotNetKicks.com | Bookmark | View blog reactions | 1 Comment »