Skip to main content

Posts

ADO.NET Data Services

In Traditional web applications, you request a page and the the server, process the request, makes some database calls if needed and put your data and HTML together and pass on to the client.This model has now changed with RIA, using AJAX, Silverlight and others Take for an example a hotel reservation page that uses AJAX for user interactions. Maybe the intital page loads with all available countries in a combo box. and when the user selects a country, all the hotels for that country is retrived through a AJAX call. Now, this is different form the typical web model, initially by requesting this page, the server send out HTML and presentation logic (javascript in this case for AJAX) to the client. The request for the hotels for a particular country is a pure data call, where only data flows in the form of XML. This example was just used to demonstrate the change from the traditionl web model, but you would find a lot more pure data calls then just one (like in this case) in real world w...

Making Applications Offline With Microsoft Sync Framework

Computers are not just on dektops anymore, we see mobile computing theses days. With the heavy use of laptops and smart phone. When data is on the move, there are advantages of taking your data offline, this would typically mean that your client would have a data cache locally. Having data locally has its own advantages, for example, your data is highly available, you can work offline even without connecting to your network (maybe while your flying). This model also reduces the network congestion, as users have there own copy of the data, they do not need to access the data via a network (this would be mostly true, when your applications is a few updates to the data but requires a large number of reads). So, then again, you can work offline but you would also want to persist your changes or use the upto date date.This is where sycronization comes in, and so does Microsoft Sync Framework. The Microsoft Sync Framework, is a set of libraries that can be used to develop offline application...

PEX - Automated Exploratory Program Testing

One of the prodcuts that is being reserched at Microsoft is PEX (program exploration).The team released a 0.5 version product last month and you can download it here .So what is PEX anyway, what does it try to solve?, Remeber how you wrote a method with "amazing" logic and you also wrote nice test cases to test this function, if the function is not very complex and have only a few paths it can take, you would end up with maybe a test case or two and some set of input data.But if your function is very complex and has a complex , you have to go through each and every path the program would take and generate you test data (and not to metion the test cases). What PEX does is, it "scans" your program (the method you want to test) and comes with a set of test data for each and every path. Lets take an example. [ TestMethod ] // mark this as a test case [ PexMethod ] // PEX attribute public void TestMethod 1(int i, int y) { GetNumber (i, y); } //The method you wa...

ATOM and WCF Syndication

Something that got me intrested is, syndication feeds, more particularly on ATOM 1.0.This might not be new news for most of us, but for the sake of a post after a long time, I had to do this !. Most of us might use feed readers, I use Feedreader, and for the people who dont know what this is all about, let me give you an intro. Think of you visiting my blog, every day to see if I have posted something new, well thats hactic, but instead the feed reader can do this for you. You simply subscribe to the Atom feed in the blog using your feed reader and your feed reader would periodically check if the blog has been updated, if so it will retrive a summary of the recently updated posts in the blog, and if you want to view the details, you can just click on a link and go there. ATOM is the standard that these blogs expose there post summaries, so the feed reader knows exactly how to display the information.you can read more about ATOM here.. ATOM can also be used in business applications, for...

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.