sharing about .NET and technology RSS 2.0
 Thursday, September 08, 2005

The RealDN site, a blog site where employees of Real Software share their knowledge about technology, has been updated.

 

Thursday, September 08, 2005 12:59:39 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] -
 | 
 Wednesday, August 24, 2005

In .NET 1.1 you cannot assign the NULL value to a value type (e.g. int, float, etc.). There are some situations where this is needed, typically in database scenarios. In .NET 2.0 there is a new type called nullable. The nullable type implements the INullableValue interface and looks like:

public interface INullableValue
{
   bool HasValue { get; }
   object Value { get; }
}

The idea is that a nullable type combines a value (Value) of the underlying type with a boolean (HasValue) null indicator. The underlying type of a nullable type must be a value type.

Nullable<int> x = 9;

Debug.Assert(x.HasValue);
Debug.Assert(x == 9);
Debug.Assert(x.Value == 9);
Debug.Assert(x.GetValueOrDefault(5) == 9);

x = null;
Debug.Assert(x.HasValue == false);
Debug.Assert(x.GetValueOrDefault(5) == 5);

You can also use the ? type modifier to denote a nullable type.

int? y = 9;
Debug.Assert(y.HasValue);
Debug.Assert(typeof(int?) == typeof(Nullable<int>));

In .NET 2.0 there is a new operator, called the null coalescing operator, ??. For example the statement x ?? y is x if x is not null, otherwise the result is y. Note that this operator also works with reference types.

int? a = null;
int? b = 6;
Debug.Assert((a ?? b) == b);
a = 9;
Debug.Assert((a ?? b) == a);
b = null;
Debug.Assert((a ?? b) == a);

Wednesday, August 24, 2005 12:48:05 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Sunday, August 21, 2005

RemotingHelper is a little helper class by Ingo Rammer that enables you to use interfaces to access remote objects instead of the implementation. In .NET 2.0 there are a lot of new features, and one of them are generics. Especially with the RemotingHelper we deal with types and with the GetObject method we can use generics to parameterize the method by type.

In .NET 1.1 we need to write something like

ICustomerService customerService = RemotingHelper.GetObject(typeof(ICustomerService)) as ICustomerService;

when using generics in .NET 2.0 we can simply write

ICustomerService customerService = RemotingHelper.GetObject<ICustomerService>();

No need to to cast and no typeof operator!

Below you find a version of the RemotingHelper using generics, or you can download the RemotingHelper.zip

using System;
using System.Collections.Generic;
using System.Runtime.Remoting;

public class RemotingHelper
{
   private static bool isInit;
   private static IDictionary<Type, WellKnownClientTypeEntry> wellKnownTypes;

   public static T GetObject<T>()
   {
      if (!isInit)
         InitTypeCache();

      WellKnownClientTypeEntry entry = wellKnownTypes[typeof(T)];

      if (entry == null)
      {
         throw new RemotingException("Type not found!");
      }

      return (T)Activator.GetObject(entry.ObjectType, entry.ObjectUrl);
   }

   public static void InitTypeCache()
   {
      isInit = true;
      wellKnownTypes = new Dictionary<Type, WellKnownClientTypeEntry>();

      foreach (WellKnownClientTypeEntry entry in RemotingConfiguration.GetRegisteredWellKnownClientTypes())
      {
         if (entry.ObjectType == null)
         {
            throw new RemotingException("A configured type could not be found. Please check spelling");
         }

         wellKnownTypes.Add(entry.ObjectType, entry);
      }
   }
}

Sunday, August 21, 2005 9:57:40 PM (Romance Standard Time, UTC+01:00)  #    Comments [2] -

 Saturday, August 20, 2005

I updated my blog site to version 1.8 of DasBlog and created a new theme called 'Business'. I will release soon a version of the theme so that you can use it for your own blog site.

Any feedback and suggestions are welcome!

Saturday, August 20, 2005 1:34:33 AM (Romance Standard Time, UTC+01:00)  #    Comments [1] -

 Monday, August 15, 2005

I have missed that one, but Dasblog has released a new version. The new Dasblog 1.8 can be downloaded here. I think that I am going to upgrade now, i'm still running 1.5.

Update: The upgrade went without any problems and the content can be converted with the DasBlogUpgrader.exe tool. As you can see there is a cool theme included named Portal from Johnny Hughes.

 

Monday, August 15, 2005 11:57:12 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Tuesday, August 09, 2005

With the DSL tools of VS.NET 2005 you can create your own designer integrated into VS.NET 2005 for a visual domain specific language. Clipcode has released a DSL for the Gang of Four patterns with the source code.

Currently it provides the following patterns

  • Abstract Factory
  • Builder
  • Factory Method
  • Prototype
  • Singleton
Tuesday, August 09, 2005 11:32:15 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Wednesday, July 13, 2005

If you are targeting Windows XP SP2 or Windows 2003 and your .NET application relies on COM components, then it is not needed anymore to register your COM components. This can be done by using manifest files. Registration-Free Activation of .NET-Based Components: A Walkthrough is an excellent article about this topic.

Wednesday, July 13, 2005 11:01:37 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Monday, July 11, 2005

I've updated the webbrowser control with a set of new features and fixes. More info on IStaySharp.Net

Monday, July 11, 2005 10:27:35 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -
 | 
 Wednesday, July 06, 2005

The session 'Turn Left or Right? How to Best Design Your Web Services Interface' at TechEd was very interesting and pointed issues like versioning, contracts, interfaces, etc.

Christian Weyer from ThinkTecture is currently building a tool called WSContractFirst (WSCF) that can generate code from a contract. Dealing with the "Melted Cheese Effect" is an article on MSDN about this subject and more parts will be published.

Wednesday, July 06, 2005 5:01:00 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -
 | 
 Saturday, July 02, 2005

A new version of the Enterprise Library has been released. More information about the changes since the January release can be found here.

Saturday, July 02, 2005 10:54:17 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Friday, July 01, 2005

One way of setting up CC.NET and VSS is that CC.NET is responsible for getting the latest version (setting the attribute autoGetSource to true of the sourcecontrol node in the ccnet.config file) or NAnt by using the vssget task of NAntContrib for compiling the sources by NAnt. I always use the csc task instead of the solution task, therefore it is necessary to have a clean version of VSS, because VSS does not automatically delete files locally that have been deleted in the VSS database.

An alternative and better way is to set a shadow folder in VSS. A shadow folder contains a copy of the most recently checked-in version of each file in the project. This is exactly what we need for compiling the sources.

That way is CC.NET only using VSS for monitoring changes in the VSS database and/or labeling.

Friday, July 01, 2005 3:51:20 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Tuesday, June 28, 2005

I am looking forward to TechEd Amsterdam 2005. No doubt that it will be a great experience and there will be a lot of interesting seminars  given.

And do not forget to register to the BeLux Country Drink!

 

Tuesday, June 28, 2005 8:16:27 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -
 | 
Thoughtworks released a new version of CruiseControl.NET.
More information about the changes can be found here.
Tuesday, June 28, 2005 9:40:14 AM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Thursday, June 23, 2005

I don't use UML on a daily basis, therefore it is handy to have a summary of the UML diagrams. A very good quick reference of UML can be found here

Thursday, June 23, 2005 11:18:08 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Thursday, June 16, 2005

In the course of next week I will release a new version of IStaySharp.WebBrowser. It contains new features, fixes and the set of properties and methods are made compatible with the webbrowser control in VS.NET 2005 (e.g.: EnableBack, DocumentText, ObjectForScripting, etc.).

New Features:

  • Implemented the Travel Log interface
  • Easy communication between Javascript and .NET through the 'ObjectForScripting' property
  • NUnit tests
  • Improved model for extending the Site (IOleClientSite) of the webbrowser.
  • Fixes and improved functionality for Mozilla
  • Printer service for modifying header, footer and margins
Thursday, June 16, 2005 10:57:06 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -
 |  | 
 Saturday, June 04, 2005

Velen die mij kennen weten dat ik een Urbanus fan ben, en eindelijk hebben ze de live shows van Urbanus op DVD gezet. Het heeft wel lang geduurd, maar ze hebben er nu toch direct 3 uitgegeven. Wat een aangename verrassing in de Fnac vandaag :-)

  

Ik hoef u denk ik niet te vertellen dat ik ze meegenomen heb :-)

Saturday, June 04, 2005 11:02:32 PM (Romance Standard Time, UTC+01:00)  #    Comments [3] -

 Monday, May 23, 2005

Thoughtworks released a new version of CruiseControl.NET.
More information about the changes can be found here

Monday, May 23, 2005 12:54:57 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Friday, May 06, 2005

It' s a pub located in Clearfield and it has a website.
Some more pictures can be found here.

Does such a pub exists near Belgium? Please let me know :-)

Friday, May 06, 2005 10:31:12 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Sunday, April 17, 2005

I've added a FAQ called How to call vbscript/javascript? at IStaySharp.NET and there is now an online demo of log4xsl

Sunday, April 17, 2005 9:35:16 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

 Sunday, April 10, 2005

I've added a FAQ entry named 'How to send data between forms' to IStaySharp that shows you how to send data with the COPYDATASTRUCT and SENDMESSAGE function.

Sunday, April 10, 2005 6:17:25 PM (Romance Standard Time, UTC+01:00)  #    Comments [0] -

Navigation
Archive
<September 2005>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Christoph De Baene
Sign In
Statistics
Total Posts: 151
This Year: 22
This Month: 1
This Week: 0
Comments: 147
All Content © 2008, Christoph De Baene
DasBlog theme 'Business' created by Christoph De Baene (delarou)