Skip to main content

Posts

WinForms : DesignMode

Back to WinForms...It was a user control which calls a service, I knew that if I wrap the service call inside a ComponentModel.DesignMode, I could get away with the service call being called at design time and the designer throwing me exceptions...Now this is not an issue at all when your are designing the control, cos' Visual Studio does not create an instance of the user control that is being designed, instead it creates a base class, UserControl, this is also true when you designing a form, a Form instance is created. Therefore .ctor of the control being designed is never called, so doesn't the service call.Now if I drag an drop this control (ctrl1) into another a control(ctrl2), the control's DesignMode property is true, but if I now drag the ctrl1 into a form, the DesignMode of ctrl1 is false.This basically means that ctrl2 is sited in the form and not ctrl1, makes sense right?.There are two work around that you can use to avoide this...1) See if the current process th...

Going Parallel With Parallel Extension For .Net 3.5

Now a days, almost all computers being used have multiple cores, for an example technologies like dual core.But, although you have dual core, generally you write programs that run on a single core, this does not utilize the total power of the multiple CPU or core that you have. This is exactly the power what Microsoft Parallel Extensions for .NET Framework 3.5 (a.k.a PFX).gives you. With PFX, you can write flexible programs that would take advantage of utilizing multiple cores in the environment it is deployed in, giving you high performance and scalabilty. PFX comes in 2 "Flavours", Task Parallel Library (TPL) and PLINQ. TPL gives you general APIs that can be used to make your program run in parallel, for an example , take the for loop below for(int i = 0; i < 1000000; i++ ) { //Do something that is not dependent on other iterations } the for loop does 1000000 iterations, and does something that is not dependent on other iterations. Running this program in a mulit core ...

Weekend at Namunukala.

Last weekend we took some time off, at Bandarawela. Climbing the Namunkala mountain and visiting some natural pools. It was a fun guranteed trip after all. This is our team.

Velocity : Distributed Caching

Caching is one way you could increase your applications response time. For an example, take a hotel reservation system, where you might need to show a list of hotels for a particular country in your reservation page. For each and every reservation made by users, a service call or a direct database call is onvloved to fetch the list of hotels for the country the user has selected, and when the number of concurrent users to your system increases, the performance of your system decreases too. To avoid these hits, caching of your hotel objects or a hotel dataset can be used, so you application can use these to respond to a request without calling the service or making a call to the database, further more the cache is updated at periodic intervals to accomadate changes to the underlying data. Velocity is an in-memory distibuted caching solution from Microsoft, still in it's CTP, addresses application scalabilty. In typical applications you would cache your data in the host your applicat...

Better Late Then Never

It's been a few weeks since I have blogged, was a bit hooked up on catching on with some of the MS technologies.I started learning the ADO.Net entity Framework, downloaded some videos, samples and ye, did some pretty intresting stuffs with it.Then there was last week, when one of my friends asked me a question on web services, got a bit confused and I had to dig into some of the ws-* standards and WCF Security, and finally thought of going through the specificaions at w3c, and I ended up reading the ws-security and ws-addressing spec.Then there was this week, started looking at some presentations on the ADO.Net data services on MIX 08, still doing this !!!. and another thing about all these is that I am getting not much of time to do all these readings, cos' I have hooked up into some of the old cartoons that I always wanted to watch, like the X-Men, King Artuher, The Mask etc...Well for all, I guess its better late then never !!!

.NET Framework Client Profile

The .NET framwork keeps on growing and so does the size, so it has become apparent that a lighter version of the .NET Framework is needed. Last week, Microsoft released the Visual Studio 2008 and .NET Framework 3.5 SP1 Beta. This includes the .NET Framework Client Profile,a smaller, optimized verson of the .NET framework needed for clients applications to run.The size of this framework is approximatley 27 MB (not that small), some of the assemblies that still lies in the beta but will be removed in the RTM version are System.Management, System.Messaging, System.ServiceProcess, System.Web, System.Web.RegularExpressions Visula Studio 2008 also has an option where you can make sure that an application targeted for the Client Profile Framework does not reference assemblies that are not included in the Client Profile Framework.You can have a look at the list of assemblies that are inluded in the client profile here

WS-* and REST, Which Is Better and Why?

I have been hooked up to REST these days after having some times to go through the WCF Web Programming Model (I know I am lagging behind in technologies !). While looking at the pros and cons of REST and WS-*, I could see more then few web pages, blogs, on the debate of what’s the best solution for SOA. REST is easy to use, no SOAP-client tool kits needed to generate web service proxies, as the fundamental concept behind REST being every operation is accessed by its unique URI, it's just a matter of typing it in your web browser, this also makes testing easier for developers (as all they need to do to see if the service is working, is to type the url in the browser !) Further more if your are practicing an asynchronous pattern such as using AJAX, it might be very easy to call a REST service, get the response in JSON and do the processing on the client side, this is much easier then using the typical DOM method to parse XML. When it comes to coupling, REST is more loosely coupled th...