LA.NET [EN]

November, 2008Archive

Nov 25

Subcontrollers and caching on ASP.NET MVC

Posted in ASP.NET, MVC       Comments Off on Subcontrollers and caching on ASP.NET MVC

I’ve just read two interesting posts by Steve Sanderson which show how to add these features to the current release of ASP.NET MVC. Really interesting, if you ask me…

Read the rest of this entry »

Nov 23

2011-01-12 11:31:56

Read the rest of this entry »

Nov 19

If you look closely at your bin folder, you’ll see that besides getting your project’s assembly, you’ll also have another assembly with the your_Assembly_name.Contracts.dll name. This assembly is known as the contract reference assembly and it only has the public “interface” of the types defined on your assembly and their respective contracts. Why do we […]

Read the rest of this entry »

Nov 18

Code contracts: the missing methods

Posted in C#, Design by Contract       Comments Off on Code contracts: the missing methods

In the last posts, I’ve been talking extensively about Code Contracts. If you’re a reader of this blog, you know that I’m hooked on it. I’ve just been reviewing the previous posts and I’ve noticed that I didn’t mention the Assert and Assume methods. Both are used for testing state and  assumptions on a specific […]

Read the rest of this entry »

Nov 12

Code Contracts and runtime rewriting

Posted in C#, Design by Contract       Comments Off on Code Contracts and runtime rewriting

Today we’re going to keep looking at Code Contracts. Until now, I’ve been concentrating essentially in presenting its use and mentioning how great it is to have static analysis (ie, have something that goes through your code at compile time and detects several places which might breaking existing contracts). Today it’s time to take a […]

Read the rest of this entry »

Nov 10

C# 4.0: named parameters

Posted in C#       Comments Off on C# 4.0: named parameters

After several failed tries, I finally managed to configure my home PC so that it runs the Server 2008 image (with the first preview of .NET 4.0) and just with a reasonable enough delay. Ok, since I”m finishing writing a book on C# 3.0 (with my good friend Paulo), I thought that I should start […]

Read the rest of this entry »

Nov 09

Code Contracts also supports are quantifiers (with several limitations, as we’ll see). This means that you can check a predicate against elements in a collection or interval. You can use the ForAll method for running a predicate over several elements maintained on an collection or interval. The Exists method will let you apply a predicate […]

Read the rest of this entry »

Nov 08

Code Contracts and compatibility with existing code

Posted in C#, Design by Contract       Comments Off on Code Contracts and compatibility with existing code

2011-01-12 11:31:25

Read the rest of this entry »

Nov 08

200 000 hits

Posted in Trivia       Comments Off on 200 000 hits

According to ClustrMaps, I’ve had 200 000 visitors on my blog since I’ve started using their product. Not bad since I never expected to hit the 100 000 mark. I would like to say thanks to Everyone who takes the time to visit this place regularly and contribute with comments on my thoughts about development […]

Read the rest of this entry »

Nov 07

Adding Code Contracts to your interfaces

Posted in C#, Design by Contract       Comments Off on Adding Code Contracts to your interfaces

[Update: I’ve changed the code so that the contract class implements the interface explicitly. This is required for getting static analysis. One more thing: the first release of the project has a bug and  even if you implement the interface explicitly, you won’t get static analysis.] One of the interest things Code Contracts lets you […]

Read the rest of this entry »

Nov 06

More on Code Contracts: out parameters and field access on preconditions

Posted in C#, Design by Contract       Comments Off on More on Code Contracts: out parameters and field access on preconditions

In this post we’ll keep looking at how Code Contracts can really help you improve your code. Today, we’ll see how one can use fields and out parameters in contracts. Lets start with fields. Ok, the title is a little misleading…you can use fields in your contract. But what happens when you need to define […]

Read the rest of this entry »

Nov 06

What’s new in the BCL 4.0

Posted in C#       Comments Off on What’s new in the BCL 4.0

I’ve just found an interesting post with some of the new stuff we’ll have on the next version of the BCL. I’m already testing Code Contracts, but it seems like there’s still a long way to go…

Read the rest of this entry »

Nov 06

Code Contracts: don’t use the overloads that receive a string

Posted in C#, Design by Contract       Comments Off on Code Contracts: don’t use the overloads that receive a string

In my first post about Code Contracts I’ve mentioned that in my machine static analysis wasn’t picking up those evident scenarios where the code was breaking the predefined contracts. Today I’ve got the confirmation on the PEX forum (which, btw, is the place where you should post your questions regarding this framework while we don’t […]

Read the rest of this entry »

Nov 06

More on code contracts: checking return values and old values

Posted in C#, Design by Contract       Comments Off on More on code contracts: checking return values and old values

Today I’ll keep writing about the new Code Contracts framework and we’ll see how we can use the write contracts that validate method return values and “old” values. Lets start with method return values… As you might expect, you’re able to refer to return values on your postconditions. To show you the kind of thing […]

Read the rest of this entry »

Nov 06

C#, LINQ and running several methods over instances of a collection

Posted in C#       Comments Off on C#, LINQ and running several methods over instances of a collection

One of the things that I’ve needed to do in the past is filter a sequence of items and then execute a specific method over each of those filtered instances. The Enumerable class introduces several methods, but it doesn’t have any that lets me pass an Action<T> that is invoked over each instance of an […]

Read the rest of this entry »

Nov 06

Not technical, so move on if you don’t like soccer…just watch how this guy reacts after receiving the yellow card :,,)

Read the rest of this entry »

Nov 05

Yesterday I was really excited after finding out that we’ll finally have a library for performing Design By Contract verifications on our code. Ok, the runtime validations could already be simulated by writing some code (I’ve already written several helpers classes in my current applications), but the truth is that the Code Contracts library adds […]

Read the rest of this entry »

Nov 04

2011-01-12 11:30:32

Read the rest of this entry »

Nov 04

The new MacBook

Posted in Trivia       Comments Off on The new MacBook

I’m pissed! I waited several months before buying a notebook. After having bought the Toshiba, Apple releases the new MacBook which is amazing…Unfortunately, I can’t buy another notebook and that makes me feel really bad…oh well, what can I say?

Read the rest of this entry »

Nov 03

Book review: More Joel on Software….

Posted in Books       Comments Off on Book review: More Joel on Software….

2011-01-12 11:30:22

Read the rest of this entry »