Framework Madness!

And other adventures C# and asp.net …

Archive for February 2010

Random Thought: Pitfall 2

leave a comment »

Freedom.

Advertisements

Written by Lynn Eriksen

February 24, 2010 at 10:19 pm

Posted in Uncategorized

Tagged with

Asp.Net MVC 2 Series at TekPub

leave a comment »

TekPub is an interesting idea in that it’s actually totally conventional: if you can present the material well enough you should get paid. In this case, I agree. Rob and Steven have done a very nice job so far presenting not only the main features but also the ‘tricks’ that can save you time and frustration. I recommend the series:

http://tekpub.com/preview/aspmvc

Written by Lynn Eriksen

February 21, 2010 at 9:21 pm

Posted in Uncategorized

Tagged with

StructureMap 2.6.1 – Looking for Documentation? Here are a few helpful tips.

with 7 comments

I have started to use StructureMap in a new project I’m incubating here at home. Version 2.6x is VERY easy to use, but it is not documented. I think Jeremy has done a very nice job making StructureMap much more approachable. But there has been so much change that most of the documentation and community helps you’ll find are now obsolete. I have only one complaint, and that is that the new version is not 3.0. With this many changes it should be.

So, back to the main point. The only documentation I’ve found is by looking over Jeremy Miller’s recent blog posts, a few video presentations he’s made, and the Google news group. Here is what I have found:

1) Usage should be scoped to ‘ObjectFactory.Container’. This will become convention moving forward. 
(See Figure 1)

2) If you use the ‘Initialize’ method you wipe the container. So go with ‘Configure’ if you want to progressively set up you IOC mappings.
(See Figure 1, 2)

3) Most mappings can now be made using the ‘For’ and ‘Use’ expressions. ‘Use’ is very powerful and simple with it’s overloads, with them you can specify a return type, return an object instance, and more.
(See Figure 1, 2)

4) You can create a scoped container. This creates an instance copy of ‘ObjectFactory.Container’ and applies a Profile mapping to it. So there are no worries about caching scenarios, HttpContext use, etc.  And the scoped container implements IDisposable so you can leverage a ‘Using’ block to force it to clean up.  
(See Figure 3)

5) The syntax for creating a Profile is a bit cleaner.
(See Figure 2)

 

Code Snippet
  1. ObjectFactory.Container.Configure(c => c.For<IModulesContext>().Use<ModulesContext>());

Figure 1

Code Snippet
  1. ObjectFactory
  2.     .Container.Configure(i =>
  3.   {
  4.       i.Profile(_StorageProfile, p => p.For<IStorageContext>().Use(new StorageContext("~/_Storage")));
  5.   });

Figure 2

Code Snippet
  1. using (IContainer Factory = ObjectFactory.Container.GetNestedContainer(routeProfile.ToString()))
  2. {
  3.     return Factory.GetInstance(controllerType) as IController;
  4. }

Figure 3

Written by Lynn Eriksen

February 21, 2010 at 9:13 pm

Posted in Uncategorized

Tagged with ,

Great Presentation Series on JavaScript

leave a comment »

Covers the history, current state and futures of the language. Very insightful. It’s a 5 part series that started in late January and will conclude in late March.

http://www.yuiblog.com/crockford/

Written by Lynn Eriksen

February 21, 2010 at 8:40 pm

Posted in Uncategorized

Visual Studio 2010 RC – Problem with parseInt/parseFloat when Using JavaScript Intellisense

leave a comment »

Posted on Connect, but I wanted to see if anyone else had this problem. Here’s the description:

When using a call to ‘parseInt’ or ‘parseFloat’ methods intellisense will become slow, and in the case of jQuery methods not work at all. Commenting out or removing the ‘parseInt’ and/or ‘parseFloat’ call resolves the issue.

Here is the code sample that busts:

Code Snippet
  1. /// <reference path="jquery-1.3.2-vsdoc.js" />
  2.  
  3. $(document).ready(function () {
  4.     //due to parseInt or parseFloat being called intellisense will slow or not work
  5.     //if both are commented out it will work properly, if one if called it slows or breaks
  6.  
  7.     var result1 = parseInt("10", 10);
  8.     var result2 = parseFloat("10");
  9.  
  10.  
  11.     //try using intellisense below this comment – it is very slow
  12.  
  13.  
  14.  
  15. });

If it fails for you too, then follow this link to Connect and confirm. The VS 2010 JavaScript intellisense is great, and we want to help get as many bugs stomped out before the final release.

Written by Lynn Eriksen

February 11, 2010 at 5:56 pm

Windows 8, or vNext, or Longhorn take 2?

leave a comment »

Here we go again? Hopefully not.

DailyTech is reporting on a deleted blog entry from an MS employee that says that what they have in mind for the next version of Windows will be very different. Sounds familiar? Makes me think of Longhorn.

I take it that since the blog entry was axed means that the Sinofsky regime still plans on:

  1. Not talking about the feature set until they have it pulled together.
  2. They don’t want to get the hype machine going.

Now I know that most of the Windows enthusiast sites hate this because it hurts their ability to get that scoop, but after as we learned with Windows 7 it is for the best.

Written by Lynn Eriksen

February 11, 2010 at 11:12 am

Posted in Uncategorized

Tagged with ,