-
|
Time for the next part in our series , the Iterator Pattern . Let's start with the definition: " Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation. " Read more at http://blog.cumps.be/design-patterns-iterator-pattern/ Read More...
|
-
|
I just received an email from my MVP lead about these new release. Seems like lately Microsoft is using CodePlex for all their releases, a very good thing. Allows developers to see the code and learn. Microsoft transparency improves every year. Everything started with Phil Haack being offered a job there? I just started using AJAX 3.5 and I’ll have to start with AJAX 4.0 now. Trying to catch up with Microsoft releases is a full time job. I’ll start playing with it and I’ll be posting the new improvements on these new AJAX version. ASP.NET MVC CodePlex Preview 4 Installer + Source From CodePlex description: “This release contains a preview version of the following features (that are also described in our Roadmap document: ASP.NET AJAX Roadmap...
|
-
|
I actually meant to say in my last post that I had investigated the API options for FriendFeed and they have a C# wrapper already available here . It's packaged up in a single download with its Python and PHP counterparts. Unfortunately, it has compilation errors. I fixed the errors and then I let ReSharper (R#) have its way with it [ R#: Ctrl+Alt+Shift+F]. Yes, I do understand that the Code Cleanup feature of R# can be a nuclear bomb of churn for diffing your source, but egads I do love it so. I also broke out the FriendFeed classes into separate files [ R#: F6] . Hmm, I just decided that I'll notate R# and VisualStudio keyboard shortcuts like this [app:shortcut]. Is there already a convention for that out there? I also decided to keep...
|
-
|
Time for yet another pattern, the Template Method Pattern . Have a look at all the other patterns in the series as well. The definition: " Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. " Read more at http://blog.cumps.be/design-patterns-template-method-pattern/ Read More...
|
-
|
Dynamically create ASP.NET user control using MS Ajax and Web Service BODY { PADDING-LEFT: 20px; FONT-SIZE: 10pt; WIDTH: 95%; FONT-FAMILY: Verdana } .code { FONT-FAMILY: Consolas;FONT-SIZE: 10pt; background: white; BORDER-RIGHT: thin dotted; BORDER-TOP: thin dotted; OVERFLOW: auto; BORDER-LEFT: thin dotted; BORDER-BOTTOM: thin dotted; HEIGHT: 150px; BACKGROUND-COLOR: #ffffff } .image { BORDER-TOP-WIDTH: thin; BORDER-LEFT-WIDTH: thin; BORDER-BOTTOM-WIDTH: thin; OVERFLOW: scroll; WIDTH: 100%; HEIGHT...( read more ) Read More...
|
-
|
Although there is not much in this project yet but I think there are few things that can be improved before moving ahead. Moving castle configuration from the App.config file to its own file: This is to remove the noise in the main application configuration file and it is as simple as extracting the castle configuration items into another file and passing that file name in the WindsorContainer constructor. Abstract IOC container: It is a good idea to abstract dependencies and therefore the reason of DI containers. But what about the DI container itself. One way to do this is to abstract it behind a separate class IOC.cs Moving the engine implementation into a separate namespace. Using Hudson as a Continuous Tool: I have used CC.NET before and...
|
-
|
Time for another, simple , design pattern. The Facade Pattern . I'm going to need a break soon, getting a bit burned out, which never is a good thing. Anyway, the definition of today's pattern: " Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use. " Read more at http://blog.cumps.be/design-patterns-facade-pattern/ Read More...
|
-
|
This Week on C9: Netflix, Extension Methods, Debugging, oh my Oh, did I also mention that they showed a 2 minute segment about my Geotag with C# post Here is the full show index This Week on Channel 9, Dan and Brian cover: - Netflix streaming coming to Xbox 360 via Gizmodo (0 - 2:00) - Roiy Zysman: Programatically geotag photos (2:00 - 3:51) - Mark Brown: Behind the Maps Series (3:51 - 4:21) - Terrarium open sourced on Codeplex via Bil Simser (4:21 - 7:05) - Chris Pietschmann: Enhance Enums using Extension Methods via dotnetkicks (7:05 - 8:20) - Karl Seguin building an open source Extensions Methods library (8:20 - 9:40) - Video clip from Daniel Pearson using WinDBG to change Notepad data live in-memory (9:40 - 13:30) - Production ASP.NET Debugging...
|
-
|
We decided to use FilteredViews instead of FetchXml for an internal project, but we ran into couple of problems. You can't access data from the FilteredViews using ASP.NET since it runs under NETWORK SERVICE (by default (app pool)), FilteredViews filter the data by Users. If you set the <identity> settings on the WCF service you'll notice it has no effect, you need to tell WCF to run in asp compatibility mode, check this link for more details. Impersonation needed for FilteredViews - EXECUTE AS doesn't work, some forums suggested we enable DB_CHAINING, TRUSTWORTHY & grant NETWORK SERVICE Impersonate for each User, we decided to take a different route since these database changes are unsupported by Microsoft. - Configuring...
|
-
|
Avoiding excpetions is always a good practice because exceptions can hurt as when thay occure. They may cause also hard performance loss. Assigning selected value to list controls is one candidate for ArgumentOutOfRange exceptions. Often this problem is solved using unhandled exception: try { cboServiceGroup.SelectedValue = group.Id.ToString(); } catch { ; } To avoid this exception we can check out if value exists in list before we assign it to list control. if (cboServiceGroup.Items.FindByValue(group.Id.ToString()) != null ) { cboServiceGroup.SelectedValue = group.Id.ToString(); } This way we will avoid a lot of exceptions in our code when we are writing user interfaces where lists are widely used. Read...
|