Creating an Integrated RIA Programming Model

Filed under: Computers
Posted by: Ashutosh
23
Mar
2008

Compared to conventional approaches of creating web-based applications the RIAs development would need significantly more use of the ‘user interface coding’. This becomes more important that the future RIAs which would also be the next generation platforms must provide an improved model for integrated RIA programming. Such a model would further simplify specific key user interface programming tasks. Such tasks would practically involve ‘Event Handling’, ‘DOM Manipulation’, and ‘Service Consumption (Ajax)’.

All these tasks enable the “rich” in rich internet application. They are directly related to each other.

Here is a model for instance.

Typical steps required with an RIA login form submission would be;

Click login Button - Event Handling

Send Service Request - Ajax

Display specific type of activity indicator - DOM Manipulation

Return Service - Ajax

Hide Activity Indicator - DOM manipulation

Display Login “Success” Message - DOM Manipulation

Majority of the existing frameworks and libraries help with light integration within these three factors despite being a direct relationship. A web-developer will have to work extra to fill out the space left.

This can be better understood with an example code. This includes setting the contents of one combo box while value of second combo box caries. Using JQuerry the code would be written as;

Example:1

 $(function(){

  $(”select#comboOne”).change(function(){

    $.getJSON(”/combo.php”,{id: $(this).val(), ajax: ‘true’}, function(j){

      var options = ”;

      for (var i = 0; i < j.length; i++) {

        options += ‘<option value=”‘ + j[i].optionValue + ‘”>’ + j[i].optionDisplay + ‘</option>’;

      }

      $(”select#comboTwo”).html(options);

    })

  })

})

Example : 2 

This time you will observe accomplishing the same task with the help of an integrated approach involving DOM Manipulation, Event handling, and Ajax;

<select id=”comboOne”

on=”change then r:load.combo2.request”>

</select>

<select id=”comboTwo”

on=”r:load.combo2.response then value[property=rows,text=text,value=value]”>

</select>

Both the above examples accomplished same task with two different approaches. You can easily notice that in the first example it required mode coding and it was all in JavaScript. The second example on the other hand used a real simple expression language for the same task.

A close look at the syntax displays;

on=”change then r:load.combo2.request” 
This is an expression with Ajax request message, r: load.combo2.request and it will be sent when <select> receives a “change” event. It is really that simple.

Have a look at another expression;

on=”r:load.combo2.response then value[property=rows,text=text,value=value]”

Contents of second combo box are set depending on the data received in the response message when Ajax response message is received as- r: load.combo2.response

Going one step ahead and adding a visual queue on receiving this response message this expression would be;

<select id=”comboTwo”

on=”r:load.combo2.response then value[property=rows,text=text,value=value]

and effect[Highlight]”>

</select>

Here simply by adding -and effect [Highlight]”> to the expression it is possible to include a subtle effect and user will come to know that the combo box values have been changed.

All these coding examples are indicative of simplicity and usefulness of ‘Event handling, DOM manipulation, and Ajax’ integration. Now it becomes far easier for those web developers who are not comfortable with JavaScript. It is easier to learn this new expression. Since this new approach does not require complex languages therefore it increases overall productivity of web developers. And it never stops using JavaScript for those who like it.

Thus, we arrive at another principle that the RIA programming model must support JavaScript in the same way it supports the separation of behavior from markup. It is termed as “Unobtrusive JavaScript”.

It can be understood with an example;

<img id=”progress_image” src=”images/indicator.gif”/>
 $(”progress_images”).on(”r:login.request then show”).on(”r:login.response then hide”);
 

Here the <img> markup becomes separate from JavaScript code defining its behavior. It means, “show” on receiving the login message and “hide” when receiving the login response.

Programming model like this would be much more beneficial for web developers because of its facilitating JavaScript in RIA programming.

An ideal RIA+SIO platform would obviously include RIA programming model. Web developers will find it as a single integrated approach for accomplishing their specified RIA programming activities. Development of rich user interface will be much faster with less coding this way.

19
Mar
2008

In the previous post it was portrayed that how the RIA+SIO is changing the future of web development and how the shift is taking place. The important steps and the important activities to start with creating an application based on the RIA+SIO was also introduced.

In continuation of this concept introduction for the web developers here are some more important aspects focusing on the programming language and widget framework.

Programming Language Support

HTML and CSS are two specific languages befitting almost all applications. These are also more suitable for the designing of general “look” of any application. In addition to that both these languages are also favored by most of the web developers for creating web based user interfaces. For this simple reason, there exists no justification for creating another language or other tool for this.

 Supporting an Open Widget Framework

As we have already noticed that the widgets are fundamental building blocks of RIAs, we will try to dig deep in to this aspect further. Currently plenty of widget development toolkits are available for web developers. Some popular tools of such type include yahoo, dojo, and ExUS. Apart from these, certain standalone widgets are also available. These standalone widgets are the creations of individuals and accomplished projects. A web developer can also make use of these pre-existing widgets. However, we are also highlighting few important aspects;

  •   This would be practically impossible that single widget would address to all your web development requirements. You need to have a set of widgets rather.
  •   You might need customized code for having integrated third-party widgets. At the same time you may also need a better understanding of your requirement as how many widgets you should have in your set and how many of them would work.
  • Creating new widgets might be a bit challenging. You would be required to write to the low level API of the toolkit of your own choice. Alternatively, you may also like to start from zero and write everything on your own.
  • Certain specific widget frameworks are oriented with their own widgets. In such situations, web developers will have to impart significant amount of JavaScript in order to use these widgets. It is a little more complex situation for those web developers who have no exposure with JavaScript.

In order to address the problems above, an RIA + SOA platform should provide an Open Widget Framework that has the following capabilities:

Web developers would be required to address all such challenges. It may be a little problematic initially. In order to ensure all such pre-requisites it is important that the RIA+SIO platform must provide some sort of ‘Open Widget framework’ facilitating the web developers and must enable them with supports like;

  • Well conceptualized support system integration for pre-existing third party widgets.
  • A support system must be in place for providing a simple API for the creation of new widgets.
  • Support for enabling widgets through simple markup. This would help web developers even if they are not comfortable with JavaScript.
  • A supporting distribution model facilitating web developers for submitting, locating, and using new widgets with no functional difficulties must be present.

Web developers would be greatly facilitated by the ‘Open Widget Framework (OWF)’ and will have single source for collecting widgets. It is one of the simplest methods to integrate widgets in to various applications. In case any particular widget is not being available the web developers would even then be able to create widgets with the help of an ‘open widget framework API’.

In the realm of RIA developments, widgets have their own importance. Present day widgets are increasingly becoming fragmented. Because of this reason also the open widget framework could be considered as an essential ingredient of any such RIA+SIO platform.

17
Mar
2008

We are witnessing a fundamental paradigm shift in the web application development. Developers around the world are feeling running in the middle of a new current. The server-side MVC frameworks of Web 1.0 are almost passé now. We are observing the growth of a new concept, the client or server architecture for the web. It is better known as the RIA+SOA. The RIA is representative of ‘rich user interface’ and the SIO would represent ‘consuming of backend services’.

Because of this shifting from Web 1.0 based frameworks to the RIA+SOA ,developers are facing new challenges while working with the new web development platforms with rich web applications. It is an opportunity to create a next generation web platform providing an end-to-end user based supports for developing web2.0 applications.

It is almost a year now that we witnessed the oncoming of “Appecelerator Platform” shifting the focus of developers across the world. This platform supports RIA+SIO.

Web 2.0 applications are becoming the favored choices of developers and users very fast. Web experts feel that these applications would not be complete in its totality if the next generation web platforms are not evolved and “fully integrated with RIA + SIO”.

The Background

Web development standards of today are mainly centered on HTML, CSS, and JavaScript. Web developers who intend to design on RIA basis would be required to assemble third party libraries and a suitable framework for creating specific rich user interface. Somehow this approach becomes an additional and extra load on the web developers just because of the RIA inclusions. The developer is unnecessarily compelled to invest a lot of time in searching, locating, integrating, and versioning several required aspects of their chosen RIA platform.

This is equally true with the SOA as well. It becomes necessary for a developer to figure out the right strategy for creating services and applications. He would also be required to finalize the exact manner in which he intends to integrate these services with their respective RIA front-ends. For this the web developers require a suitable platform helping in dealing with every minute aspect of the application development. It would be all the more important in ensuring the desired end results for creating applications.

Here comes the biggest challenge. It is about the future of web development. And the biggest question is what should be the face of this new next generation RIA+SOA platform? We will make an attempt to draw a picture of this future platform on this canvas and we will also try to make use of few working conceptual examples in order to help you understand the concept in better way.

Let us begin understanding with the initial activities that would be required for creating a RIA+SIO based user friendly application. Such types of initial activities are actually the basic foundation of such applications.

Giving a “Face” and “Look” to the Application Design

It is the starting point where everything revolves around conceptualization. It is all about general feel and look of the application. In other words it is the general appearance of the application and normally includes deciding on the aspects like color, fonts, graphics, and general page layout. At this stage the conventional tools like HTML, CSS, Images, and JavaScript’s are generally prove helpful for the web developer.

Widgets Integration

Widgets have become almost top desired application today. For a web developer the widget serves many purposes. It envelopes a complete set of common capabilities and that too with single component. A typical widget is an ideal expression of both the “look” and “feel” and it also signifies a “set of pre -defined dynamic behaviors”. Because of these clubbed advantages, widgets have become an almost necessary and basic building block for an RIA. Web developers could easily use the tools like ExUS, Dojo, Yahoo YUI, and many additional widget specific applications.

Introducing Dynamism in User Interface

Creation and development of dynamic behavior and adding this to the user interface is an important step which is basically divided in to two parts. The first part is “Event Handling” which is basically the capability to pre-estimate an event. This can better be understood with an example. When a user clicks any button or when a response is received for any service are some of these examples.

Second part constitutes the “Document Object Model (DOM) Manipulation”. Dom manipulation will facilitate a web developer to change the user interface with all dynamism depending upon the receipt of an event.

JavaScript libraries including JQuery, Prototype, and Scriptaculous are some of the common tools that can be used by web developers in this stage.

Consuming Backend Services

For an RIA the key capability is its consuming backend services. This specific capability enables a web developer designing and creating single page user interfaces. This facility provides an exchange application data with the services. This capability facilitates both the developer and the user to define a clear separation between the user interface and the service tier. “Ajax” is one such common method which is used for such separation and interacting with services.

Creation of Services

Creation of services is an important aspect which extends the application business logic. In addition to this the service also provides an interface to the data. A number of applications and frameworks are available to the web developers for creating services in their preferred programming language.

06
Feb
2008

“Search Engine” and “Web Directory” are two different search concepts. Normally, the users tend to use search engines by typing in keywords into a search box. It is a quick and easy way to locate any specific information on the internet. Although these two terms reflect the similar connotations but they differ from each other significantly.

‘Search engines indices’ are built up by robots or crawlers while the ‘Web Directories’ build up their indices through human editors. There exists a mix where search engines and directories contain both a computer-generated index and a human generated index. Such types of ‘mixed-indices-configuration’ are known as the “hybrids”.

“Search Engine” and “Web Directory” are two different identities related to the search services available to the Web community. Many times both these terms have been understood as reflecting the same meaning and this becomes confusing.

Understanding ‘Search Engines’ becomes easier with some popular names like ‘Google’, ‘Inktomi’, ‘AltaVista’, and ‘AlltheWeb’. These are forms of search engines. These search engines write programs known as robots, crawlers, and spiders that have the three major functions. The first function is to locate web pages. Second function is to read the contents of the web pages and the third major function is to report its findings back to the search engine’s indices or databases.

Normally the search engines plan to update their index either on a bi-monthly or monthly basis. When web searchers use a search engine to locate web sites that are relevant to the keyword search, they are actually searching the search engine’s index. A search engine with a larger and more up-to-date index therefore is a better representation of the information available within the website realm and it gives out the most relevant and most recent search results.

‘Web Directories” on the other hand, can be best understood with a visualization of popular names including ‘Yahoo!’, ‘dmoz.org’ (Open Directory Project), and ‘Gimpsy’. These all are forms of ‘web directories’. These web-directories use human editors to review different websites that are submitted for submission to the directory. Directories, unlike search engines, use a hierarchical tree structure to organize their database.

Another common differentiating factor is that a directory tends to list websites with specific reference to the root directory of a site or homepage whereas a search engine will list web pages in reference to the individual pages of a website. Because of their dependency on the manual processes of adding sites to a directory, the web directories normally require to supplement their search results with a search engine partner to increase the relevancy of the produced search results.

Working of the web directories does not involve all those complexities like algorithms, robots, search spiders, and crawlers and this makes them comparatively simpler in operation. Search engines, on the other hand, have to be understood properly regarding their working mechanisms.

Search engines necessarily have their own confidential algorithms that determine which Web pages are to be shown first. The algorithms assign weights to certain components or variables that it finds within a page. Some specific search engines consider the text within the title of the page as determinants. Title of a page becomes important to search engines in such search environments and the search engine gives it a higher weight. There are three major reasons. Firstly, it is displayed on the top of the menu bar in the search browser. Secondly, the title is displayed in the search engine results page and thirdly the title is displayed in the search browser bookmarks when this particular page is added as the “favorites” or “bookmarks”.

The particular weights priorities enable the search engine’s algorithms to synchronize and show one Web page over another, determining the page ranks. The specific variables and the suggested weights assigned to those variables are for a separate article. If a webmaster intends to promote his website and want users to find his site, it must be ensured by the webmaster that a search engine spider makes an access to his site and read the respective code. Once this is ensured a webmaster should proceed to make efforts in ensuring that content is written in contextual manner and contains targeted keyword specific language.

Search engines and Web directories have different technology and business practice bases. “Search Engines” use complex algorithms to facilitate the end user to find and locate the answer they are seeking out of a particular search operation. On a different note, the “Web Directories” use a hierarchical tree-like structure to navigate the end user to the information of interest. Both are valid methods to search and both have their pros and cons. They both however have the same basic objective, to help the end user locate a site of interest.

“Web Directories” require a browsing through their hierarchical structure instead of the searched structure. Humans assign titles and descriptions that might not be within the source code of the page. Web directories may also have a submission fee for adding a particular website to a particular category classification on it. The submission fee is to cover the costs of having the human editors review the site. Most directories will only add a new site if it has unique content that is presented in a professional manner by a legitimate company. However, the number of web directories with no submission fee or subscription fee is growing as a new concept.

Perl 5.10: Some Praiseworthy New Features

Filed under: Computers, News
Posted by: Ashutosh
31
Jan
2008

“Perl”, a dynamic scripting language, introduced a new and improved version, the first in over five years.  This is the first update since 2002 to the “practical extraction and report language”. “Perl 5.10″ adds both new language features and an improved Perl interpreter, according to community site Perl Buzz.

“Perl” is a dynamic scripting language widely used in everything from Linux system utilities to Web servers to full-blown graphical enterprise applications.

“Perl” has a long 20-year history now and during all these years it gained massive popularity by assimilating the syntax from many predecessors, making it really easy to use for anyone already versed in ‘sed’, ‘awk’, ‘grep’, ‘csh’, ‘C/C++’, ‘Lisp’, and so on.

Perl’s syntactical flexibility sometimes makes perl scripts challenging to read. On the other hand, the languages like ‘python’ with its rigid syntax structure have arguably gained ground in recent times over ‘Perl’, for applications that are developed collaboratively.

In addition to that, scripting languages specially-made for use on the Web, like’ PHP’ and ‘Ruby’, have eroded some of perl’s once formidable share of the dynamic Web server scripting scene.

One of the most attractive feature of the ‘Perl 5.10′ is the new ‘or’ operator, //, which is a “defined or” construct.

For example, the following statements are syntactically equivalent:

$foo // $bar

defined $foo ? $foo : $bar

An expert would definitely identify that the first line is much more compact and more readable. This clearly means that it is “$foo defined”. Therefore, an equal sign also can be placed like;

$bar //= $foo;

It is almost the same as writing;

$bar = $foo unless defined $bar;

Another praiseworthy new feature of this programming language is its “smart match operator”. ‘Perl Foundation’ described this as “a new kind of comparison, the specifics of which are contextual based on the inputs to the operator”.

This remarkable “smart match operator” appears to be aiming at making Perl’s relatively strong typing easier to work with. The “~~” operator apparently guesses the type from context, allowing lazy comparisons.

Of this new feature, ‘ Perl Buzz’ comments, “The result is that all comparisons now just do The Right Thing, a hallmark of Perl programming”.

For instance, to find if scalar $needle is in array @haystack, it would now require to apply the ” ~~ operator”;

if ( $needle ~~ @haystack ) …

‘Perl 5.10′ has a specific support for the named “regex statements”. Programmers will now be in a position to avoid the hard to decipher dreaded lines of $1 $2 etc. It will be easier to understand what’s going on in complex ‘regex scripts’ such as the ‘Markdown’.

Perl guru Ricardo Signes highlighted  its new language features  that include  a ‘switch statement’ said to go “far beyond” those found in C, C++ or Java and Regex improvements which is a “Named captures” aimed at reducing the need for positional captures along with Recursive patterns said to be useful in parsing.

All new features can be upgraded without breaking the existing scripts simply because these features have been turned off by default. It has been enabled for progressive upgrading the scripts with the “use” syntax.

Scott Gilbertson explains this in a better way. He advises to add the line use feature ’switch’; prior to a block of code where you’d like to take advantage of the new switch statement in Perl 5.10 and then turn it off after upgrading that block of code using the statement no feature ’switch’;. New features can be enabled by name or as a collective group using the statement use feature ‘: 5.10′.

Apart from this ‘switch statement’ there is also a new ‘say statement’ “which acts like print() but adds a newline character and a state feature, which enables a new class of variables with very explicit scope control” says Scott Gilbertson.

‘Perl’ is an interpreted language instead of being just a compiled language. This unique characteristics of ‘Perl’, makes it a human-readable code that can easily be interpreted a ‘Perl Interpreter’.

“With the 5.10 release, the interpreter gains speed, while shedding weight”, ‘Perl Buzz’ claims. Other interpreter improvements include ‘Relocatable installation’ for more file system flexibility, more portable Source code, and fixing of many small bugs.

‘Perl 5.10′ has several other interesting improvements including a faster interpreter with a smaller memory footprint, and better error messages. Many experts in programming have found that “Perl 5.10’s new features are definitely worth the upgrade and a must have for anyone who uses Perl on a daily basis”.

Site of the week

Evolved interfaces Title: Evolved interfaces
PR: 1

Latest WP Theme

MyRealEstate Name: MyRealEstate
Author: David

Latest on Wp Market

Rewards of Freedom Name: Rewards of Freedom
Author: MGC design team