Geeks With Blogs

View Szymon Kobalczyk's profile on LinkedIn

Szymon Kobalczyk's Blog A Developer's Notebook

The source code for SmartPetShop, my sample project for Composite UI Application Block, is now available for download.

If you want to run it, first I recommend to download and install the original PetShop.NET 3.2 from Microsoft , as it will setup properly the database and register COM+ services. After that you should update the connection strings in Win application's app.config with encrypted settings taken from original Web PetShop's web.config. Simply find settings like and copy them to app.config. Later I will try to provide my own installation scripts for this. Finally, to compile the code you would need to place CAB DLL's om the Lib folder.

Currently my changes concentrate only on presentation layer so I simply replaced the Web project with my own Win project. All other code remains unchanged (with kind of proves that this is indeed well architected application).

Future plans

My first goal was to create sample application that would demonstrate how CAB can be used in real-life project. But during the process I realized I can further extend this sample and try to apply some other new technologies emerging in .NET world. So here are my future plans for this project.

  1. Finish conversion to Windows Forms

    From the original Web PetShop there is only couple of functions left to implement (for placing orders). But looking at CAB I already covered following features:

    To make it complete I still need to discuss:

  2. Reimplement Data Access Layer using Enterprise Library

    CAB is only a little brother of EntLib so I think it makes sense to show how to use them both in the same application. I'm also curious to what degree it will simplify the original code for the data access and business logic layers. I will definitely explore the Data Access AppBlock but I will also try include others like Logging, Exception Handling and Caching. Also, I should try to replace the PetShop's ConfigTool with EntLib's Configuration. At the same time I would try to deploy the database on MS SQL 2005 Express using user instance databases and embedded update scripts (seen nice articles on both recently).

  3. Separate client code from server

    I called my version SmartPetShop to indicate that it will support the SmartClient architecture. There are three main characteristics of SmartClients: rich user experience, intelligent updates, and offline capabilities. If we assume that my CAB implementation provides richer experience that the previous Web based (actually it tries to mimic it closely) there are two things left to address. For installation and updates I would use ClickOnce, but there is not much to say that wasn't well known already. So last thing is to enable the application to work without connection to server. In this mode it should at least enable to browse the product catalog and place items in shopping cart. Then, when application goes on-line, user can submit orders and check status of earlier orders.

    Currently the application connects directly to database so the main task here would be to move the data access and business logic to separate server process. Necessity to connect these two will allow me to explore another exciting new technology, the Windows Communication Foundation (aka Indigo). This will also test the current architecture as it seems that it should suffice to switch ServiceAgent implementations and there should be no change to UI logic.

  4. Another type of client

    When I'm done with above I should have working example of SmartClient. Then I can try to implement another type of clients. There are two candidates. I'm really excited to start working with Windows Presentation Foundation (aka Avalon), however I don't think I would have opportunity to apply it in my professional work in foreseeable future. It is more likely that I would need to refresh my skills in ASP.NET. I stopped working on Web apps almost one and a half years ago and didn't had opportunity to try out all the goodies in ASP.NET 2.0. I'm also excited about the Atlas extensions since I've done some work with AJAX technologies on my own (some really cool DHTML behaviors).

So here you have it. I will try to do as much as I can of this in upcoming months. I need to learn these things anyway but if I also put myself to write about it the process is more systematic. Feel free to drop me a note if you have additional ideas or like me to explore any particular topic more closely.

Update: I just discovered that last week Microsoft released .NET Pet Shop 4.0. What a perfect timing! I guess I need to revise my goals as some became obsolete. Most notably these guys saved me work (and pleasure) of upgrading to ASP.NET 2.0. I haven't reviewed the code yet but judging from the accompyning article most changes were made to the presentation layer (bummer!). However, it seems it would be easier to update my code base now before starting any modifications to other layers. Anyway, it's great this project is not dead and I'm sure it will be valuable source of information on building enterprise .NET 2.0 applications for everyone.

Posted on Sunday, February 19, 2006 11:46 AM Development , Smart Client | Back to top

Comments on this post: CAB sample published and future plans

# re: CAB sample published and future plans
Requesting Gravatar...
Hi there,
Checked out the link
to download your sample app , but the page has no url for a download, only
the text - Demo Url: N/A. Have you removed the app ?

Anyway , great blog on CAB !
Left by Jimmy on Mar 01, 2006 2:17 PM

# re: CAB sample published and future plans
Requesting Gravatar...
There is 'Project Releases' box on the right. Follow the '2006-02-19' link to go to download.

Here it is dirrectly:
Left by Szymon on Mar 01, 2006 3:46 PM

# re: CAB sample published and future plans
Requesting Gravatar...
Cool. Thanks. This is just what I was looking for! Runs great.
Left by bobthecoder on Mar 16, 2006 7:10 PM

# re: CAB sample published and future plans
Requesting Gravatar...
I tried to download the sample app, and only received the following error...

ProjectDistributor - Application Error!
Unspecified application error


Return to site

The administrator of this site has received an e-mail notifying them of this error.

Great site, by the way
Left by Rohan on Mar 27, 2006 11:34 AM

# re: CAB sample published and future plans
Requesting Gravatar...
Thank you for doing this work and making it available.
I have the source compling with Sharp Develop 2, Beta 3 , but now what to get PetShop running.

You ask for the MS version to be installed, and this is where I have a problem. I have a working SQL EXPRESS, but the installer won't create DBs at all, and then rolls back. Neither do I have a Web Server.

Please could you make available the SQL scripts from your installation so I can create DBs manually. Also more info on Connection Strings that you refer to above.
Left by John R on Apr 25, 2006 9:24 PM

# re: CAB sample published and future plans
Requesting Gravatar...
Hi again,
I see you have included the SQL scripts within the directory structure. So I now have my DB created.
I've now found why the MSI Installer fails, because the password for the mspetshop accounts to be created is "password" and this fails the password enforcement when using Window Authentication. But I couldn't get Mixed mode to work either, So created DBs manually.

Now all i'm missing is the Connect Strings, and where to put them.

Also I have SampleVisualizations.dll missing. What is this?


Left by John R on Apr 26, 2006 9:11 PM

# CAB isn't so easy to learn...
Requesting Gravatar...
After spending a few hours trying to figure out the responsibilities of all the elements of CAB, I found
Left by Guy Burstein's Blog on Mar 09, 2007 5:14 PM

# re: CAB sample published and future plans
Requesting Gravatar...
I get a missing reference to SampleVisualizations.dll.
Where can i find the SampleVisualizations.dll?
Left by balaji on Apr 04, 2007 8:51 AM

# re: CAB sample published and future plans
Requesting Gravatar...
The source code for SmartPetShop cann't download.

the website have errors.
Left by David on Dec 31, 2008 10:44 AM

# re: CAB sample published and future plans
Requesting Gravatar...

Is there any way I can have the source code. The pubilshed link ( for downloading the source code is not working.

Left by Ishwar on Apr 16, 2009 11:34 AM

# re: CAB sample published and future plans
Requesting Gravatar...
how can get source code ?????
Left by Ritesh mkumar on Jan 11, 2010 2:14 AM

Your comment:
 (will show your gravatar)

Copyright © Szymon Kobalczyk | Powered by: