Presentation Layer Toolsets and CAB

Topics: CAB & Smart Client Software Factory
Mar 23, 2006 at 12:29 AM
originally posted by: Brujah

Hello all,

First let me state that I’m new to CAB and .net development, so please forgive me if this seems a little naïve.

I have been looking into CAB and think that it would be ideally suited to a small project that I have coming up. I have also been looking at presentation layer toolkits, namely Infragistics NetAdvantage 2006 and ComponentOne Studio for .NET to use with this (and future) projects.

Now the Infragistics toolset makes a big play about having a CAB Extensibility Kit making it easy to work with the CAB framework. This leads me to question if there is any difficulty in combining other toolsets with CAB. ComponentOne Studio has some extra components that would be very useful but if it dose not play nicely with CAB or is tricky to use, etc then…

Does anyone have any opinions on this subject?

Thanks for your time.
Mar 23, 2006 at 2:06 PM
originally posted by: puy0

Very good question...
I'm asking myself the same one...
But more about DevExpress suite...

After (rapidly) giving a look to "Infragistics.CompositeUI.WinForms", it doesnt looks like to me so easy to implement.
But maybe i'll must do it or i will not benefit of CAB facilities.

Anyone else?
Mar 24, 2006 at 5:08 AM
originally posted by: matiaswoloski

CAB has many features: the EventBroker, the concept of a WorkItem, SmartParts, Services, and more. These can be used without implementing the toolset for CAB.
Then you have the UI part and I will separate it in 3 topics:
- UI Elements/UI Extension Sites
- Commands/CommandHandlers
- Workspaces

UI Elements/UI Extension Sites

Another feature CAB has is abstracting the UI elements (like menus, toolbars, explorer bars, etc.). So you can treat them as just "sites" where you can add new elements from any module. Let me clarify this. Think about the Outlook Shell. When you switch between Mail, Calendars, Contacts you have different toolbars and different menu items. You need a mechanism to add/remove to these places.
That said, the Toolbar is an "extension site" in terms of CAB, the ToolStripMenu is another, the Status Bar is another. When the Mail "module" is activated, it will add/remove what it needs to the extension sites.
If you want to add UI elements to these sites using the CAB infrastructure you have to implement the "Adapters". These are very easy to implement. They are just small wrappers of your controls with Add/Remove methods.

Commands/CommandHandlers

So what happens when you click on a ToolsStripButton of the Toolbar? You need to handle that click and do something with it. The Commands defeat that purpose. If you are use to double click the toolstrip button in the designer surface to create the event handler, then in CAB you won't have that facility.
From a module developer point of view you will add invokers to a ui element like this:
Commands"Reply".AddInvoker(replyButtonItem, "Click");

And then you will consume this event using a CommandHandler
CommandHandler("Reply")
public void ReplyHandler(object sender, EventArgs e)
{
ReplyMail();
}

The way to integrate this with your toolset is by implementing the CommandAdapter for the specific UI element that raises the Click event (the ToolStripButton, the ExplorerBarItem, etc.)

Workspaces

Finally you have workspaces. These are layout/containers. They will abstract the addition/remotion/hiding of smartparts. That means that you will add smartparts to a workspace and the workspace wraps a layout container. Eg. Tab, Deck, Dock, Zone, etc.
This will let you change how the smartparts will be shown in the shell with a minumum effort.

-----
Finally, you can learn how to implement these 3 elements by:
- looking at the CompositeUI.Winforms project
- by downloading and looking over the CAB Extensibility kit of Infragistics [[url:http://www.infragistics.com/resource/Technologies/CAB]/]
- Dockable CAB Workspace [[url:http://www.codeproject.com/useritems/DockableCabWorkspaces.asp]]

Also, I've been exploring the Janus controls and helped a company implementing the ExplorerBar adapter and the TabWorkspace

Hope this helps,
Matias
http://staff.southworks.net/blogs/matiaswoloski
Mar 24, 2006 at 10:15 AM
originally posted by: puy0

Thanks a lot matias, very comprehensive and detailed informations.
I've also looked at your blog, full of useful informations too!
And i smiled when i've seen your UAB2 not resuming downloads post since i had to do the same fix few monthes ago...

I have 30 days to prototype a complex SmartClient architecture with a sexy outlook look and feel...
(and also a bunch of funky little funny stuff like encryted webservices, message queues, nhibernate persistence layer and so on)
I hope i will have enough time to learn cab&scbat, implements extensions to support DevExpress.
Btw, i say devexpress since they look good, but i'm not sure yet on which component suite i'm going to choose, so if you have any feedback or advice i'm interested.

Once again, thanks
Mar 24, 2006 at 10:43 PM
originally posted by: Brujah

Thanks Matius and puy0.

That has gone a long way to futher my understanding!