So, today I was at CodeCamp 2009 in Rotterdam. It was organized by SDN, Stichting dotNed and VBCentral. It was a great day, learned a lot and talked to many people. In this post I will summarize the 4 tracks I attended.
Around .NET Framework 4 by Ronald Guijt
In this session Ronald demoed some new features of .NET Framework 4. He had 1 PowerPoint slide with items he was NOT going to talk about:
- a new CLR. Not built on top of former CLR’s for .NET Framework 2/3, but a fresh one.
- DLR. The Dynamic Language Runtime, for languages such as F#.
- Garbage Collector. When cleaning-up process is executing, it’s non-blocking now.
- Environment.Is64bitProcess and Environment.Is64bitOperatingSystem support
- MEF. Managed Extensibility Framework.
No, Ronald had other interesting stuff to show in 23 demo’s.
- Keyword dynamic. With this keyword it is now possible to type a variable or method at runtime.
public dynamic TestValue( dynamic p )
if( p is int )
- Optional parameters. Although VB.NET has this feature since ages, C# has it too, now!
public void ShowMessage( string message = “Default message”)
When having multiple parameters, the optional parameters must be defined last. But, what about overloads? Bare in mind that all signature combinations must stay unique.
- Contract class. As with the Debug class, the Contract class is also part of System.Diagnostics. The Contract class looks like the Debug class, but it is intended to test preconditions and postconditions.
- IObservable interface. Defines a provider for push-based notification.
- Task class. We know threading and tasks are on top of threads. When starting multiple tasks, a finished task can take over another task which hasn’t started yet. The most common way to create tasks is by using the task factory:
var task = Task.Factory.StartNew(() => DoAction());
Other demo’s that were shown:
- Complex class (Math)
- Enums: HasFlag
- Parallel class for parallel computing
- PLinq, parallel Linq
- Entity Framework: from model create database and vice versa, ComplexType which is made of multiple fields.
- Workflow Framework: improved performance, improved WCF support/integration
- WCF : easier configuration, discovery
For more information on what’s new in .NET Framework 4, click here.
SharePoint Nightmares by Marianne van Wanrooij
The second session had a great start: a video of the Twilight Zone. Marianne was presenting real life scenario’s you don’t want. She categorized the horror scenario’s in 3 parts: Architecture, Customization and Coding.
Architecture was about choosing the number of site collections. When the project started the choice was made to have 1 site collection to store 2000 sites each having 1-4 subsites. Every site had it’s own 6 security groups. After some time the scope changed: 16000 sites and 10 security groups. You do the math, but 1 site collection does not do the job!
Hence, know you’re boundaries and be prepared for growth!
The second example was about customizations and defining content types, custom field types, templates and custom standards for metadata. This time the custom field type with validation code was the problem, because the customer used InfoPath and Word document. However, validation on custom field types in the DIP, doesn’t work. It works only in the Web UI of SharePoint.
Hence, know you’re dependencies!
The third and last example was all about coding.
- Dispose created instances of SPSite, SPWeb and SPList. Otherwise the server keeps the resources alive and performance will drop. A good tool to use is SPDisposeCheck.
- SPWeb.Lists[“speakers”] != SPWeb.Lists[“speakers”]. True. Both will result in a new instance of SPList.
- Looping through list items should be done with SPQuery result and not on SPWeb.Lists[“speakers”].Items. This last statement will ALWAYS retrieve all items in the list.
for( int i = 0; i < 100 && i<list.Items.Count; i++ )
SPListItem item = list.Items[i];
if the list contains 1500 items, they will all be retrieved on the Count-call and once again on list.Items[i]. You don’t want that. Better to use the SPQuery object and set the RowLimit property.
SPQuery query = new SPQuery();
query.RowLimit = 100;
SPListItemCollection items = SPContext.Current.List.GetItems(query);
Surface Development by Dennis Vroegop and Freena Eijffinger
I never seen the Surface table in action, so that’s why I chose this session. And I was not the only one, so seeing the demo’s was hard. Too many people. Nevertheless, Dennis and Freena explained the concepts of Surface very well. It’s all about people sitting around the table and using the table intuitively. To achieve that you have to develop NUI applications. Natural User Interface. This means no list boxes, no checkboxes and no menu’s. It’s all about objects, like a chair, a living room, a tv, a table.
There are 2 Surface units: Commercial (€11000) and Developer (€13000,-) . When you have the developer unit you get Visual Studio 2008 Express. Yep, Express, the free one. Surface is built on Windows Vista and .NET Framework 3.5 SP1.
And developing for Surface is easy. You have 2 choices: XNA or WPF. XNA is mostly used for gaming and has the ability to access the hardware directly. WPF is more well-known among the .NET developers. Together with the Surface SDK you can quickly start creating Surface applications. There’s a Surface project template available.
For more information about Surface Development, click here.
SQL Azure by Marcel Meijer
Since the introduction of Azure there was no data storage yet. Well, blobs and tables, but no relational storage. But times are changing. SQL Server is now part of the Windows Azure Platform.
With this first version of SQL Azure there are some restrictions. When creating a database you provide a name and a size (1Gb or 10Gb). Then you can set some firewall settings for accessing the database.
SQL Server 2008 Management Studio will not be able to connect to your cloudy database. You’ll the R2 version. Or, install the SQL Azure Explorer in Visual Studio .NET 2010.
For more information about SQL Azure, click here.