Showing posts with label Workspace. Show all posts
Showing posts with label Workspace. Show all posts

Smart Client Application Components

Thursday, September 24, 2009

Smart Client Application has major six components.
- Application Shell

- Workspace
- Work Item
- Smart Parts
- Modules
- ProfileCatalog.xml
We will discuss above component in the details.


Application Shell
• The main user interface common to all the dynamically loaded modules is the Shell. Typically a form, it always hosts a root WorkItem, which is the root access to all the services, modules, and WorkItems registered by the modules.

• Derives from the class “FormShellApplication” in the namespace “Microsoft.Practices.CompositeUI.WinForms”.
public class MyApplication : FormShellApplication{}


Workspace
• A workspace is a control that is primarily responsible for holding and displaying Views.
• The Composite UI Application Block includes the following types of workspaces:

- WindowWorkspace
- MdiWorkspace
- TabWorkspace
- DeckWorkspace
- ZoneWorkspace

• The Workspace class has functions for :

- Displaying a View
- Hiding a View
- Activating a View
- Closing a View

WorkItem
• A WorkItem is a class encapsulating all the logic required for a use case.

• Technically, it's a container that contains all the required objects such as views and their presenters or controllers, state and commands.
• A CAB application has a tree of WorkItems. The Application Shell contains a reference to the root WorkItem. Given a WorkItem, you can go up one level to its ParentWorkItem, or down to the next level by accessing the workItem.WorkItems collection.

• A WorkItem also contains various other collections.
It has collections of:
- Workspaces
- SmartParts
- Commands
- EventTopics
- Services
- Items

Smart Part

• SmartParts are the visual components of the application. They are hosted by a Workspace.
• You can create SmartParts by simply customizing a standard user control. All you have to do to make a control a SmartPart is to mark the class with the [SmartPart] attribute.

[SmartPart]
public partial class MySmartPart : UserControl
• They are designed to be pluggable and reusable within the same or other applications.
SmartsParts communicate and cooperate between themselves by publishing and subscribing to events.


Modules
• A module is a collection of components (Work Items, services, and so forth) that are needed when performing a certain task.

• You can separate areas of your application into different modules to be able to deploy them to different users or applications.
• When one module has a dependency on another module, you express the dependency with the ModuleDependency attribute.
The CAB will load modules based on the contents of the ProfileCatalog.xml file.

Profile Catalog.xml
• Tells CAB what modules your app has

• Your application will not load a module that is not listed!
<solutionprofile xmlns="http://schemas.microsoft.com/pag/cab-profile">
<modules>
<moduleinfo assemblyfile="CABDemo.Inbox.dll">
<moduleinfo assemblyfile="CABDemo.Calendar.dll">
</modules>
</solutionprofile>

 
 
 
Your Ad Here