Wednesday, April 1, 2009

Comet - Reverse Ajax - Server Push

We see many attempts to bring Rich User experience - more of a- app like features to the modern browser users.

Numerous frameworks developed based on Java scripts handling browser DOM model to achieve Rich UI. These frameworks are currently leveraging the Asynchronous Requests to the server- AJAX. These requests are made from browser to server, however little research or development explored on the other way around - server pushing data to active browser sessions which would result in more of applet like applications on browser still proving better performance.

Comet - a new word - used to describe web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it

There are many methods currently employed for this technique.

Example applications:

Google chat , Meboo






Monday, March 30, 2009

Javascript : Anything can convert to Boolean!

Most powerful languages are very simple to program and very complex to master. and no doubt Javascript is one among them!

As Javascript as minimal data types, and in times anything can be potentially converted to boolean value, and the reason is few values [0, false, '',undefined, null] are equate themselves to boolean FALSE.

So, here is an example to convert any data type to equate to a boolean value.

var val=5;
val=!!val;
alert('Numeric Value:'+val); //true

val=0;
val=!!val;
alert('Zero Numeric Value:'+val); //false

val = '';
val =!!val;
alert('Empty space value:'+val); //false

val = undefined;
val = !!val;
alert('undefined value:'+val); //false

val = new Array();
val=!!val;
alert('Array Object value:'+val); //true

val= {};
val=!!val;
alert('Empty Object value:'+val); //true

val=false;
val=!!val;
alert('Boolean value:'+val);  //false

val= null;
val=!!val;
alert('Null value:'+val); //false




Albeit this power can mislead to type safety, it certainly adds great value when used wisely.

Hope you do so :-)

Monday, March 23, 2009

eRights - Unified Access & Concurrency Control for IT Products

We might have used Lightweight Directory Access Protocol [LDAP] used to control user authentication and entitlements for enterprise applications. 

Albeit open source ldap can fulfill extensive access control mechanism complex entiltments for enterprises, it potentially lacks concurrency enforcement for which many of us, would have employed other custom solutions [like tracking session id/access id with respect to application usage etc]

eMeta attempts to bridge the gap between access & concurrency controls through its unified approach via its eRights suite.

The product description goes as below.....

"eRights is an enterprise-information commerce software package for the online 
information industry. It provides authentication, access control, concurrency control. 
It helps IT product enterprises to  implement sophisticated personalized licenses 
and allow organizations to extract products from large databases of information.

eRights directly addresses the problems of selling and distributing information 
online by recognizing that information products are built from elements of 
content and application services that can be packaged in different ways to 
address different markets. eRights optimizes the many paths and usage terms and 
makes user, access, and product information available to other components of 
content distribution systems, such as personalization and content management 
software, content protection technologies, and payment systems."


Lets analyze a custom implementation on eRights :-

Resource 

The bottom of hierarchy starts with resource - that can have id and name. This is atomic unit of access control that can be devised. 

Product

The set of resources are grouped together and called a product - this can be real world business entity. 

User

This represents individual user / role that can access the product. Apart from regular name, id, password,  details it can also store as much customer info as possible.

Group

The set of users - called as Group that represents a team/organiztion unit/ a department etc.

Other than individual user access - group login/password also can be configured. 

License

The users and/or groups are assigned a product or set of products with set of rules governing validity time period, trial/preferred access, concurrent usage, number of logins etc which is called Licensing.

Concurrency Maintenance:

When a user logs in, an eRights session can be tied with the user record which can keep track of concurrency. 

Programming interfaces:

eRights offers application programming interfaces for many standard programming languages [Java, .Net, Perl etc] which enables application developers seamlessly integrate eRights into their application suite.

Conclusion

Concurrency control is certainly a step ahead on product marketing and its worth to consider unified solutions like eRights.


More info: 
http://www.emeta.com



Thursday, March 5, 2009

Composite Configuration

This Configuration class allows you to add multiple different types of
Configuration to this CompositeConfiguration. If you add Configuration1, and
then Configuration2, any properties shared will mean that Configuration1 will be
returned. You can add multiple different types or the same type of properties
file. If Configuration1 doesn't have the property, then Configuration2 will be
checked.




























Here, if you want to override any of the configurations mentioned by default, simply define them in APP_1

Monday, January 12, 2009

How to check what version of JavaScript supported in Browser

Run the following code in any browser thru HTML page. You will get the answer.



<script type="text/javascript">
var jsver = 1.0;
</script>
<script language="Javascript1.1">
jsver = 1.1;
</script>
<script language="Javascript1.2">
jsver = 1.2;
</script>
<script language="Javascript1.3">
jsver = 1.3;
</script>
<script language="Javascript1.4">
jsver = 1.4;
</script>
<script language="Javascript1.5">
jsver = 1.5;
</script>
<script language="Javascript1.6">
jsver = 1.6;
</script>
<script type="text/javascript">
document.write('Javascript version ' + jsver+ ' supported');
</script>


Note:

Firefox, Netscape 7/8, Mozilla, and Opera 7+ all support version 1.6
Netscape 6 supports version 1.5
Opera 6 supports version 1.4
Netscape 4.5, Opera 5, and Internet Explorer 6 support version 1.3
Netscape 4 supports version 1.2

extJS - Javascript library for RIA

Ext JS is a cross-browser JavaScript library for building rich internet applications. It includes:


  • High performance, customizable UI widgets
  • Well designed and extensible Component model
  • An intuitive, easy to use API
  • Commercial and Open Source licenses available
  • Scope in Javascript

    Variable scope describes when a piece of information is accessible.
    When a variable is created, the value it stores is only available for a certain part of the code execution.
    Memory is set aside to store that piece of information and then freed when it is no longer needed.


    JavaScript, a variable declared outside of a function is available inside a function:


    var name = "Jonathan";
    function showme()
    {
    alert(name); // will display "Jonathan"
    }
    showme();


    A variable declared within a function will not be available outside of a function.


    function showme()
    {
    var name = "Jonathan";
    }
    showme();
    alert(name); // name will be undefined


    #1 Do not use global variables from within a function
    Instead, pass in any required values as parameters to the function.

    Using our JavaScript example from before we can do this:

    var name = "Jonathan";
    function showme(myname)
    {
    alert(myname); // will display "Jonathan"
    }
    showme(name);
    alert(name); // will display "Jonathan"


    #2 Use object-oriented programming (OOP)
    This mantra is similar to the first point, but on a larger scale. Instead of a collection of functions that perform related tasks, the functions become methods of an object. (A method is a function that belongs to an object.) Values can then be passed into the object in a variety of useful ways:

    By setting the properties of an object
    By passing values as parameters of a method
    By passing values as parameters of the constructor (the method that gets executed when an object is first instantiated)
    Here’s a quick JavaScript OOP example:

    function Person(myname)
    {
    this.name = myname;
    }
    var me = new Person("Jonathan");
    alert(me.name);