WCSF Evaluation Comments

Topics: Web Client Software Factory, UIP Application Block discussion, User Forum
Apr 25, 2007 at 12:43 PM
Hello every one,

Please feel free to comment if there is something missing/wrong in following evaluation. These are based on my findings.....!

1. Does every request of creates a pageflow instance?

It is based on following two approaches,
a> Page flow can be configured to handle the page flow instance to persist. This requires defining the PageFlowInstanceStoreProvider and PageFlowInstanceTokenProvider details. By default the instance providers are bound to SQL Database. These providers follow provider pattern and hence are extensible. The attribute abandonable to AllowAndSaveInstance of the page flow (State Machine Workflow) will persists the page flow instance in the persistence data store. Since the page flow instance is closely associated with token and the logged in user, the authorization mechanism should be in place.
b> Page Flow can also bypass the data persistence. This may not require the authorization in place.

Based on above approach, the page flow instances are created if there is no instance associated with the logged in user and toekn. If there exists already an instance of page flow for the given user and the token, it will be retrieved from the data store and will be given to the Windows Workflow Runtime.

2. Is the page navigation based on Redirection or transfer?

The page navigation is based on Redirection of the url property set on the PageState activity of the workflow. Every page is associated with the PageState. Based on various actions, the pages are redirected to the PageStates which in turn is the ASPX page. This will be handled by the navigation services of the page flow application block.

3. What and how the dependency injection come in place?

The dependency injection is getting used by the page flow application block for the modified pageflow and the provider. A new request accesses the page flow provider by referring the web.Config file for the provider details. Thus ObjectBuilder come into picture and the injects the provider as mentioned in the web.Config file.

4. Can transition be applied without stopping the web application?

Yes, the application requires the page flows to be defined and deployed. Thus the assembly containing the pageflow need to be loaded back in the server. And this assembly will be loaded dynamically using the provider that injects the code on pageflow instance startup using ObjectBuilder. Thus, on a new request coming in, a new page flow instance is created and it accesses the modified version of the pageflow.

5. Can I modify page flow navigation without recompiling or restarting the application?

No, The page flow application block is built on top of Windows Workflow Foundation runtime services. The page navigations are built using the State Machine Workflow and uses the extended versions of State activity. The new inclusions in defining the page flow are using the PageState and TransitionListener activities. These are not the direct XAML versions of the page flow and is a compiled dll. This dll needs to be deployed onto production environment to take effect.

6. When to use page flow application?
Page flow application block can be used for complex page navigations and also on conditional navigation. It is useful in following scenarios
1. Complex page navigations
2. Conditional page flows
3. The data to be persisted between the transition is heavy
4. When the database is Sql Server
5. When the application require functionalities such as resume and continue
6. Applicable when the cookies are enabled

7. Page Flow persistence usage

Page flow instance is stored with respect to the token. The page flow application block defines CookiePageFlowCorrelationTokenProvider. A token will be issued on the logon of a user. Each token is associated with the logged in user. These token details are stored a cookie on client side and in the PageFlow_InstanceStore table in the persistence data store on server side. When a request is sent to web server the application block retrieves the token details from cookie on client machine associate this with the logged in user and the pageflowInstanceCorrelationSqlProvider retrieves the pageflow instance based on pageFlowType and CorrelationToken from the persistence data store and passes to the requester. On arrival of the requested page, the pageflow instance information is updated in the persistence data store to fetch it next time to resume the original flow.

After completing a cycle of the page flow the page flow instance for the selected user will be removed from the persistence data store.

8.Dependent assemblies of WCSF

WCSF uses following assemblies,
a. Microsoft.Practices.CompositeWeb
b. Microsoft.Practices.CompositeWeb.EnterpriseLibrary
c. PageFLow
d. PageFlow.Storage.EnterpriseLibrary
e. PageFlow.WorkflowFoundation
f. Infrastructure.PageFlow

9. Difference between the page flow persistence and in memory persistence

By default page flow application block uses the persistence data store to manage the user data and the page flow instances. This is configurable attribute at web.Config file. It is based on provider model. The default provider supports SQL Server. PageFlowInstanceCorrelationSqlProvider must be modified to cater to any other database if required. In memory can utilized in page in the form of out-of proc for state management.

10. Deployment of page flow application block in clustered environment

The only problem with such scenario could be bypassing the persistence data store and using in proc memory. By default Page Flow Application block uses the SQL data store to manage the data and page flow instances. If the application does not require the persistence and utilizes simple navigations, page flow application block can still be used with in-memory data caching, but this will implementation would impact the deployment as webfarm.

11. Redirection Vs Transfer in Page Flow Application Block
The navigation services of Page Flow application Block Redirect to the concerned page as defined by the pageState in the State Machine Workflow. This hits the performance as there are two requests on the server. An alternative is to modify the navigation service of the page flow application block.

12. Externalizing configurations for Page Flow Application Block
Currently page flow uses the Data Access Application Block for accessing the persistence data store for workflow instances and user data. The configurations include page flow provider, run time details, workflow instance provider and token provider details.

13. Can page flow be used for win Forms?
No, It is not a goal of Page Flow Application Block to support console applications, Windows Forms, or Avalon forms-based applications.

14. UIP vs Page Flow Application Block
Page Flow application block is supersede version of UIP. The latter uses the XML configurations for page navigations. The page flow application block uses the .NET 3.0 Windows Workflow Runtime Services for page navigation and includes intuitive GUI for defining the transitions between the pages. The navigations can now be based on the rules. It also uses the SqlDataPersistence services to store the instances of the page flow and the user data to be carried between the sessions using the SqlServerProvider.
Following are the benefits compared to UIP,
a. Page navigation based on Roles
b. Support to handle Back Button
c. Conditional navigation based on data
d. Linkage between different page flows to trigger the other page flow.
e. Suspend and resume support.
f. Constrained page flow. User will not be permitted to navigate randomly bypassing the defined page flow.

15. Migration strategy of existing applications using UIP to Page Flow Application Block
The guidelines to migrate the existing application that uses the UIP are available with the WCSF documentation. The navigations defined in XML must be translated into page flow and using the UIP manager the workflow can be kick started. This requires considerable amount of changes to the existing code where the UIP is getting used. The guidelines are well documented in WCSF help files. One of the major disadvantages over UIP is usage of page flow that doesn’t allow the change in navigations without recompiling the code.

16. Can I dynamically create pageflows?
No, Dynamically building pageflows is not supported by WCSF. The page flow should be well defined before starting the application. Certain classes such as WorkflowFoundationPageFlowDefinition used by page flow application Blocks are read-only. Hence dynamically setting the attributes is not permitted.