Monday, April 23, 2007

Winforms Tabbed UI using multiple forms

The problem at hand was how to create a Windows Forms application that uses a tabbed UI, but where you want to put the logic into separate forms, i.e. each tab page is a separate WinForm (this is mainly to not have all the code and controls in the main page).

I found 3 main approaches to this (there are probably more, but these accomplish the stated goal without excessive coding):

1. the MDIWindowManager project (free under BSD license)

2. the DockPanel Suite project (free, from SourceForge)

3. do-it-yourself (VB.Net code)

Private Sub AddFormToTab(ByVal objForm As Form, ByRef objTabPage As TabPage)
objForm.TopLevel = False
objForm.Text = ""
objForm.MaximizeBox = False
objForm.MinimizeBox = False
objForm.ControlBox = False
objTabPage.Controls.Add(objForm)
objForm.Dock = DockStyle.Fill ' Expands the form to fill the tabpage
objForm.Show()
End Sub


Use this method in the main form to add a form to a tab page.
The do-it-yourself method is simple and works, the other 2 links with the accompanying source code provide more functionality.

Tuesday, April 17, 2007

Everyone's talking about RIAs now...

It seems to me that the current hot acronym is RIA (Rich Internet Applications). I first read about it on Adobe's website when reading about Adobe Apollo (see my post on this). Now Rick Strahl has published a very good post about the trends we're seeing in the end user application development space. He does a great job putting things like WPF, WPF/E, Adobe Flex/Apollo, HTML/AJAX in perspective. As I said before, something is going on there that every serious developer needs to keep an eye out for...
I like one of the comments to his post (and pretty much mirrors my experiences):

"Another great read Rick. I have to admit that the last two big projects that I was on both were vb6 -> asp.net/ajax conversions and BOTH got halfway through development and were re-architected for clickonce and wpf because ajax still doesn't allow you to throw 30 infragistics web combos on a page. Some presentation layers just don't work well with html and probably never will granted time and a hardware refresh might change that.
When there's a preexisting expectation of the thick client experience, even ajax doesn't cut it. I'd like to see more of this clear separation of layers. The asp.net code behind model doesn't give you the ability to cut with clean lines where ui starts and the last layer stopped. throwing cab and things like ioc into the picture just complicate things. I'm all for the service model. I think Flash is there but they never got it right for the developer. It wasn't until flex builder that they released something with intellisense. Flex is nice but it just adds more overhead and is an abstraction for people who aren't core coders. ..."

Tuesday, April 10, 2007

SQL Server BLOB datatypes going away

This is something to be aware of:
It looks like the SQL Server datatypes TEXT, NTEXT, IMAGE are going away sometime in the future as noted in SQL server Books online: "ntext, text, and image (Transact-SQL)".

So for any new tables that need to store large data fields, M$ is suggesting to use VARCHAR(MAX), NVARCHAR(MAX), and VARBINARY(MAX).

Thursday, April 5, 2007

Adobe Apollo

A colleague of mine pointed out Adobe Apollo to me.
This is a very interesting technology and just confirms the trends that seem to be crystallizing in the application development space.
- pure web applications are reaching their limits in terms of usability
-> Web 2.0 wants to address that with AJAX, but the underlying protocols/languages (HTML) are just too old
- the large deployment of existing browsers, different browser technologies and the security implications that lead to tighter browser security limit what can be delivered to the user even using Web 2.0
- the user wants a seamless experience with applications that are powerful and allow desktop access and disconnected operation

-> It seems that the major players in this field are realizing this and the solution offered is a completely new "browser" - a new runtime to host new and improved content and make it feel more like a desktop application (speed, access to local file system and apps, disconnected operation)
- Microsoft introduced WPF/E as a new runtime to run XAML applications
- Adobe is working on Apollo (synergy between Flash, PDF, HTML, JavaScript, Ajax according to their web site)

On a related note, Microsoft's Click-Once technologies try to address the deployment and maintenance problems that plague desktop applications.

So basically the convergence of these technologies is targeted to the enhanced user experience. The user wants the best of both worlds:
- web app's ease of deployment, always up-to-date, highly portable
- desktop app's speed, UI features, disconnected mode, access to local system resources

We'll have to see how this pans out, but this is definitely something that seems to be here to stay and I think we haven't seen the last of this.
Especially if Adobe manages to create their Apollo runtime for the Windows Mobile and Linux platforms (and maybe Symbian/PalmOS devices) this might be a technology that can catch on.

But in general, for me as a developers this means to be aware of this trend and keep up with the technologies involved

ASP.Net Cache clarifications

Tess from MSDN has a very good post on some common ASP.Net Cache pitfalls and misconceptions here.