Wednesday, October 24, 2007

Marching into the land of Microsoft Office Sharepoint Server

I just installed Microsoft Office Sharepoint Server 2007. It goes pretty straight, just that a lot of stuff need to do before the installation:

- Apply latest service packs on Windows Server 2003. So I installed sp2 and did all update.
- I installed .net framework 3.0 runtime, which already included the 2.0 runtime installation.
- I setup IIS with iis registration script

And then just run the install.

I'll probably also install Office 2007 and use it as a sharepoint client.

Wednesday, October 10, 2007

Complex problem, simple answer

I can't believe that I didn't though of it before, but yeah, thanks Daniel, my colleague at work place, for providing me a solution on combining all DLL needed to deploy a ASP.Net user control.

Originally I had 3 solutions in mind:
  • Rewriting the user control into custom control.
  • Use ILMerge to merge all DLL into one DLL. [Example]
  • Create a ASP.Net 2.0 web site (instead of an ASP.Net web project), compile the code and grab the DLL with strange name. (It mentioned in MSDN magazine, and also in this blog.
Well my friend Daniel told me the 4th solution: why not just combine all the projects (Presentation, Business Object and Data Access) into the user control project! Then we will only have one project .. one DLL ... simple.

Well ... I'll damned,but I am trying it out now.

Package DLL into one assembly for user control

My teammate wanted to package a UserControl into "a single DLL with single asmx" deployment thing. I found this article that may solve my problem.

Broken rule Pattern

Here some info about Broken Rule Pattern in CSLA.Net .

Learned from code review

- You initialize an object in variable declaration like:

public static readonly ContactInfo = new ContactInfo(constantCompanyName);

- You can use interface to differncitate differnt presenters targetted to differnt platform, like one for web and one for WPF:

public class SearchEnginePresenter : IWebPresenter

- .... is there a design pattern called Broken Rule Pattern?

- There's an argument about whether we should call a collection of Rules as "repository". Seems like repository is a "Domain Driven Design" thing.

- Domain Specific language encourages using Positive English Phrasing instead double (or qudriple) negative like !(IsNotRight(!IncorrectItem(a)).

- Instead of using HasBeenSaved(), use IsDirty or IsNew which sounds clearer.

- Seems like a lot of code use "out" to return value... doesn't look too OO..

- Readabulity Issue: Is the method "ThisIsNotTheItemsWeAreLooingFor() " a more readable method ..... a debate....

- Role of Presenter: how much workflow logic should be in presenter, or should we use Presenter as as thin a layer as possible, and call Business Layer as much as possible in presenter instead?

- use nullable type (int?) as return value is a good way to differentiate empty value return and no return. And try aviod using checking zero as indicator of no return. nullable type is here, so use it.

Tuesday, October 09, 2007

Interop between Blend 1.0 and VS.Net 2005

After an attempt to merge Blend created UI into Visual Studio 2005 (with WPF), I found out that:

  • When you are at Microsoft Blend and try to create a new page, remember to create the code file too. Otherwise it will get messy later on (like when try to integration your code back into Visual Studio.

  • Sometime there are issues that you don't see unless you have some data put inside the control. So it could be beneficial if you bind some static XML data to the control just to see how things look like.

  • It's way way better to actually open the VS Solution in Blend 1.0 instead of just opening a project. You will see the benefit when you do a Test Project in Blend.

Microsoft Expression Blend 1.0: Right direction, long way to go

I was intensely using Blend 1.0 for the last one day, and my impression was that:

  • Blend 1.0 is a much better way to learn xaml. Switch between code and graphic view gives you better understanding about the power and limitation of Xaml.
  • The videos tutorial provided by Microsoft are extremely helpful. On the other hand, online help sucks.
Since I am such a bitchy person, here's my complain on Blend 1.0.
  • Difficult to Stack Panel and items within it. I need to get used to the Selection and Direct Selection thing. Turns out the best way to select stuff is from "Object and Timeline".
  • Moving label into a Panel will result in losing the text! I was like, what the *&%%$%^&(- . Sigh, never mind.
  • Switching between Design and XAML view doesn't automatically select the corresponding code or object. We really need that to be productive, man!
  • No intellisense for XAML on XAML view ... bad... bad ...
  • Not much flexibility on rearranging workspace. You basically only have 2 workspace setting: time line and regular. The best you can do is yank everything out of the main window.
  • The hell! Just seconds ago I crashed Expression by messing with timeline.
Finally let me bitch about the XAML technology itself.
  • Xaml does not allow percentage in width and height based on the hosting container. Admitted by a PM in Microsoft, there's no stronge Layout concept in Xaml ... yet. Well, one can alway dream.

Monday, October 08, 2007

MyGeneration not portable friendly

At first I thought my generation is portable friendly, but turns out it's not.

Object binding with WPF

Just learn from a hardway (by wasting 1.5 hours) that when object binding to a control in WPF, only properties are presentable using DataTemplate. I used this before:

public string ProductCode;

and couldn't get the data displayed. Turns out I have to do:

private string mProductCode;
public string ProductCode ....
.................


Well, at least I got it solved.

Friday, October 05, 2007

Having Visual Studio 2005 and Visual Studio 2008 Together

I figured out from the hard way that you cannot installed Visual Studio 2005 extension for WPF Nov 2006 CTP if you already have Visual Studio 2008 beta 2 installed on your machine. Though goddness that I figured this shit out through using VMWare. If I have them installed on my hosting workstation machine I will be totally screwed.

But I still have to deal with the pain that Visual Studio 2005 doesn't read Visual Studio 2008, and vice verse. My plan on crossing over two world doesn't seem to work as I planned.

LINQ and Dynmaic Typing

Well, this guy really thinks that dynamic typing is a good idea. In the meantime, Likethis article really shows the problem of dynamic typing).

To me, I am just starting to learn that in C# 3.0. Hopefully someday I will find a reason to justify it .. like .. LINQ.

Wednesday, October 03, 2007

Rundown for my little WPF/Popfly/Silverlight/Blend presentation (v.2)

Windows Presentation Foundation

Visual Studio 2008 Beta 2
  • Demo: MVP on WPF, Simple App, and Simple User Control
  • Beta fustration:
    • Where the heck is control event?
    • Crash once in while. Thank goodness for auto save.
    • Behave strangely with TestDriven.net
    • Slow update on XAML UI (Require faster hardware for fancy rendering?)
  • Side note: VMWare Server 1.0.4:
    • Simple way to test new environment without messing your box.
    • Core2Duo native: "Virtualization" support
    • Fast performance
    • Free.

Blend
  • Graphic design tool for Xaml
  • Round trip editing between designer and developer

Silverlight
PopFly
  • Microsoft's answer for social networking site Gadget (like iGoogle, gadget in Facebook)
  • Overview video
  • Right now you can only host projects at Popfly Space
  • Value to us: the Xaml based interface, seeing what direction Microsoft heading

Setting up Test Driven Development with Visual Studio 2008 Beta 2

Here I am, setting up Setting up Test Driven Development with Visual Studio 2008 Beta 2:
  • Installed NUnit : NUnit-2.4.3-net-2.0.msi (really need to install first)
  • The I tried to install TestDriven : TestDriven.NET-2.0.1714_Personal.exe. Well it failed. So I tried TestDriven.NET-2.8.2130_Personal.exe. And it worked. At least right click shows the proper menus. When I right click a test case and try to run test though, I got "Couldn't connect to test runner process". Still I can just right click -> [Test with ... ] -> [InProc]