C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




User Interface Process Application Block – Part 1


Posted Date: 02 Jun 2005    Resource Type: Articles    Category: .NET Framework

Posted By: Balamurali Balaji       Member Level: Diamond
Rating:     Points: 10



Introduction



Introduction



You all must be familiar of developing multi-tier applications in which you segregate business logic, user interface, database objects, and web components into different layers. When you consider designing the user-interface, you need to put more work on user-interface designs, navigational flow, user-interactions and no wonder you admit that you need to put some logic within the user-interface itself for accomplishing them. Imagine, you developing many small applications, or, designing for large-scale applications. You could come across a sort of redundancy in few of the coded lines that decides your navigational logic and user-interaction. But, still you got to accept the fate of re-writing them for multi-platform applications finding no way to re-use, maintain or extend the existing code.

User Interface Process Application Block introduces you a new concept of designing your application given due consideration for workflow, navigation, and interaction with business services and components as separate concerns from how data is acquired and presented to the user.

Consider a scenario where your application needs to maintain state. Storing and Retrieval of states from the form is going to be difficult to implement which again affects the extensibility and reusability of a user interface. Suppose you develop a wizard-type of several forms to be viewed sequentially, and then you need to insert a new form in the sequence, you must recode or modify both the previous and subsequent forms to incorporate the new form.

The User Interface Process (UIP) Application Block (v2) provides an extensible framework to simplify the process of separating business logic code from the user interface. You can use the block to write complex user interface processes such as navigation and workflow control, state management, saving a snapshot of current user interaction, by splitting the presentation layer into manageable units.


Some of the terms used in User Interface Process Application Block



UIP: A set of user-related activities that achieve a goal.
UIP task: A running instance of a user interface process.
UIP state: A snapshot of a task that can be persisted.

Presentation layer is divided into the following layers:



User interface components: These are visible components make up the user interface of the application. Users see and interact with these components and are responsible for user input/output
User interface process components: These are invisible components controls the user interface elements and coordinate background activities, such as navigation and workflow control and state and view management.

Model-View-Controller pattern



The MVC architecture has a long history, since the days of Smalltalk, where it was originally applied to map the conventional input, processing, and output tasks to the GUI model. The same concepts are good enough to map multi-tier enterprise applications.
Model: It represents the enterprise data and business rules that govern the access and updates of data.

View: It represents the presentation of data and is responsible rendering the content. It maintains the state even when the model changes. It uses Push model to register itself with the model for change notifications and Pull model to call the model for retrieving current data.

Controller: It represents the translation of interactions with the view into actions to be performed by the user. User-events and Application request calls are some of the controller actions.



Both the view and the controller objects depend on the model object. However, the model depends on neither the view nor the controller. This is the major advantage for the separation so that the model alone can be built and tested independently from the visual presentation.

Implementation of MVC architecture:



You can find MVC architecture anywhere in applications you use now a days. Be it J2EE or .NET architecture! Though the separation of view and controller in client applications bind roles into one object, web applications still give you a clear isolation between the browser views and server controller components.

Benefits of UIP block approach



It is the user interface process that controls the workflow, not the business process. Coding behind the user interface elements should be avoided and the process code is developed separately. Abstraction of code for navigation and workflow from user interface layer into user interface process layer facilitates you to port a windows user-interface to web application, and a web application to some device application.
If you want to maintain states within the application, UIP Block is useful to extract the state from the user interface. Any type of view can access the UIP state information.
At any given point of time, you can take a snapshot of a UIP state, store it in database or any isolated storage and use it later. UIP application block has a state persistence mechanism to redeem the persistent UIP state. That is, when a user leaves the application or shut down the system, UIP block can store the state in SQL Server database, Web Session Object or memory and return back to the point of state easily after a while and resumes his session.

Design of UIP Application Block



The UIP Application Block contains several classes and interfaces that combine to provide an infrastructure you can use with your own applications.
Model — Implemented in the State class. Stores both user information and control information within the user interface process.
View — Implemented in the WebFormView, WindowsFormView, and WindowsFormControlView classes. Used to create views in your application.
Controller — Implemented in classes that derive from the ControllerBase abstract class. Responsible for the starting of, navigation within, and ending of a user interface process.

Elements of UIP Application Block



1.Application: Contains code for calling the appropriate start task method on the UIP manager.
2.Configuration File: Contains application configuration information.
3.Controllers and Controller Base: Controls the navigation between views and acts as a facade between the user interface layer and the business layer. Provides access to the business logic of your application.
4.Services, Business Components: The services (such as Web or data services) and business logic of your application.
5.UIP Manager: Provides entry points to the UIP Application Block for starting or loading a task with a variety of navigators.
6.Navigator: Manages transitions between views and determines the appropriate view, asking the view manager to activate it.
7.UIP Configuration: Retrieves, verifies, and stores the information contained in the application configuration file.
8.Views: User interface elements for user interaction.
9.View Manager: Creates and activates views as requested by the navigator.
10.State: Maintains user process state and maintains the current view in the task.
11.State Persistence Provider: Captures the states to be stored in the state persistence store.
12.State Persistence Store: Preserves the state.


Summary


What we've seen now is just the fundas behind the UIP application blocks. In the next part of the article, we would know, how to create and implement UIP blocks for our applications.





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Conversion of Decimal number to any Base and vice-versa
Previous Resource: User Interface Process Application Block – Part 2
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

it support

Contact Us    Privacy Policy    Terms Of Use