Categorized under: Sketch

So Microsoft have a good product here, or don’t they?

Web development is becoming more and more difficult for us developers, especially front end development. Your project starts with an image from the designers with how the website should look like, and it is your responsibility to write an html code that will reflect the image. It is not simple, and it will never be. Even if you have the perfect HTML WYSIWYG you will still need to dive into the code to fix some stuff in order to reach the compliance with the standards out there.
The most difficult part of the front end development is to ensure that the site looks alike in different browser. At least it must look the same with IE, Firefox, and Safari. There is still Google Chrome and Opera if you want to prefect your site among all popular browsers. Also, we should not forget the different versions of browsers with no exception to IE. So as a developer you need to have all those browsers in your OS which makes it very difficult to maintain and sometimes impossible like installing all IE versions in your OS. This is why there are some web applications like browsershots.org that will generate snapshots for your website on different platforms. But don’t forget your site needs to be online in order to test it which is not the case when starting to develop the site unless you upload every change to a test server.
When I started to work on my latest project, I remembered that I bookmarked a blog that talks an easy way to test your web design. I don’t remember reading that blog, I just bookmarked it. So I went to delicious to see the blog post. It is titled “Microsoft SuperPreview: a New Way to Test Web Sites” and written by Craig Buckler. I said to myself ‘Not another Visual Studio Add-on. I just scanned down the blog and saw another interface. Wow, this doesn’t seem like something from Visual Studio. I returned back to the beginning of the blog and read it, then immediately downloaded the 250MB application which is labeled with March Preview.
My first impression when installing the application is satisfying. The installation UI seems very cool and got me excited about this app. When the application started it looked very strange. I mean there were no menu items. It looks more to a browser rather than a designing app.
It took me some time trying to understand how this app works. The first site to test is Yahoo! and the result was a pure image. I tried to click on some links but with no use, at the end this is a site preview application not a browser. I have added IE 6 and IE 7 as browser to test the compliance and as expected Yahoo! gave me a message to upgrade to the latest IE version when previewing the site using IE 6.
I know that this is a beta version but there are many issues to consider in the final release:
1. It must support all the major browsers; Microsoft already is already planning to.
2. There is a need to support resolution for previewing the websites, which is also in plan.
3. The most important is the support of interaction or sending events. We all know that modern day websites relay on XHTML for interactivity. So unless I am able to test those from the browser or I don’t know how the site will behave under different browsers.

I suggest you try it to see how much it will make your life simpler.

Categorized under: Sketch

Does Web Services Message Provide Reliability?

Web Service uses HTTP protocol as a communication channel, HTTP also uses TCP/IP protocol. The whole purpose of TCP is to be able to transfer data reliably and so it employs acknowledgements and sliding window mechanisms to guarantee the delivery of the data. That’s said; does Web Service Message provide reliability?

The answer to that is HTTP itself is inherently unreliable. Or I should say HTTP provides reliable communication as it uses TCP/IP. This is true when everything goes fine. However when things goes wrong many issues arise. In this article I shall explain the concerns about reliability, security and transactions in Web Services as well as the HTTP. Unfortunately, writing about these issues requires hundreds of pages not a single page. So I will only mention the issues that most developers might face. Moreover, we are going to shed light on some of the WS-* specifications; mainly WS-ReliableMessaging, WS-Security and WS-Transactions.

Reliability
Generally when a client (browser) requests a page; three way handshaking take place at the beginning and at end of the message exchange between the client and the server. TCP always knows the state of the connection. I will not explain this because everyone knows about it. Many errors may interrupt a conversation. Messages may be lost, duplicated or reordered. Furthermore the host systems may experience failures and lose volatile state.

When I talk to people about reliability in Web Services, they always tell me that in case of Web Service if you have synchronous method. It’s known that synchronous methods are blocking that’s the initiator will wait/block until it gets response either success or fault message.  So the client/Initiator will know about the message in case of a failure. So it’s reliable???

Unfortunately this isn’t true!!!  Figure 1 distinguishes between application software and communication software as this makes it easier to discuss some of the failure scenarios. Consider what happens if the communication connection is lost after step 1 and before step 4. In this case, the consumer will get a connection failure event and it will be “in doubt” as to the status of its request. Several cases might hold:

fig1

1. The request might not have been delivered to the end point.
2. The request might have been delivered to the endpoint and processed, but the endpoint might detect that the connection has been lost and “rollback” its processing.
3. The request may have been delivered and processed successfully at the endpoint, but the reply confirming this is still waiting for delivery back to the consumer.
4. The request might have been delivered and processed and the reply could have been lost while being sent back to the consumer, but the endpoint might not know about the connection failure or might not be able to rollback its processing at this point.

Note: We are talking about Reliability at this level. We will cover Transactions later.
Note: This problem occurs in HTTP requests as well. Many of us had to check to avoid the user hitting the same button twice, right :)

So where does it leave SOAP/HTTP services? Based on the explanation above, SOAP/HTTP is not the best fit when:

  • Service providers can’t handle message duplicates (in other words, an operation performed by the service is not idempotent).
  • Different data resources owned by service provider and service consumer must be in synch at all times.
  • Service provider can’t handle message order. You need write the logic yourself.

Solution:
WS-I (is an industry consortium chartered to promote interoperability amongst the stack of web services specifications.It is governed by a Board of Directors consisting of the founding members (IBM, Microsoft, BEA Systems, SAP, Oracle, Fujitsu, Hewlett-Packard, and Intel) and two elected members (currently, Sun Microsystems and webMethods) ).

WS-I proposed WS-ReliableMessaging Specification.  The original specification was written by BEA Systems, Microsoft, IBM, and Tibco and in March, 2003 and subsequently refined over the next two years. The February, 2005 version was submitted to the OASIS Web Services Reliable Exchange (WS-RX) Technical Committee in June of that year. The resulting WS-ReliableMessaging 1.1 was approved as an OASIS Standard on June 14th, 2007.

Prior to WS-ReliableMessaging, OASIS produced a competing standard (WS-Reliability) that was supported by a coalition of vendors; namely Fujitsu, Hitachi, NEC, Oracle Corporation, Progress Software, and Sun Microsystems. Most of these vendors now also support the WS-ReliableMessaging specification.   [Wikipedia]

For complete details about WS-ReliableMessaging please refer to the spec document. I will explain the how it works in very brief way.

fig2

As you can see the spec adds two new components named RM Source Transmit and RM Destination Receive. These components are the real deal here. It is the responsibility of the RM Source and RM Destination to fulfill the delivery assurances, or raise an error.

There are four basic delivery assurances that endpoints can provide:

AtMostOnce Messages will be delivered at most once without duplication or an error will be raised on at least one endpoint. It is possible that some messages in a sequence may not be delivered.

AtLeastOnce Every message sent will be delivered or an error will be raised on at least one endpoint. Some messages may be delivered more than once.

ExactlyOnce Every message sent will be delivered without duplication or an error will be raised on at least one endpoint. This delivery assurance is the logical “and” of the two prior delivery assurances.

InOrder Messages will be delivered in the order that they were sent.

The Reliable Messaging (RM) Source accepts the message and transmits it one or more times. After receiving the message, the RM Destination acknowledges it. Finally, the RM Destination delivers the message to the Application Destination.

WS-ReliableMessaging is not bound to underlying transport protocols or sessions. This means that the lifetime of a WS-ReliableMessaging conversation can span long periods of time (days, weeks) even when one or both systems are rebooted. This allows conversations to be suspended mid-stream (for example, to allow system maintenance) and then resumed without needing to retransmit the entire conversation.

WS-Implementation

If your environment doesn’t support WS-ReliableMessaing yet, what can you do?
These are the CRUD operations which are the basic operations that make up your service.

Operation

Required Service Consumer Behavior

Required Service Endpoint Behavior

Create Must be able to retry the call
Must be able to handle “record already exists” error.
Must be able to handle duplicate messagesMust be able to handle message ordering
Read Must be able to retry the call None
Update Must be able to retry the call Must be able to handle message ordering
Delete Must be able to retry the call
Must be able to handle “record does not exist” error.
Must be able to handle duplicate messagesMust be able to handle message ordering

References

Sepc http://specs.xmlsoap.org/ws/2005/02/rm/ws-reliablemessaging.pdf
MSDN http://msdn2.microsoft.com/en-us/library/ms951247.aspx
Reliability of SOAP over HTTP Web Services [Very good blog entry] http://www.myarch.com/reliability-of-soap-over-http-web-services

Hope this helps

Categorized under: Sketch

Simple JavaScript Debugger using jQuery

Debugging has been one of the main tools developers use to detect and find application bugs. These tools vary from simple print statement to sophisticated tools such as IDE debuggers and profiling tools.

In Web development there are server and client side. Before the emergence of AJAX technology, few developers were interested to debug the client side. Partly because of the client libraries (Java Script) were simple and partly because the web interface did not use extensive javascript at the first place. However, this has changed with the RIA websites. These types of website heavily depend on AJAX and use too much javascript.

Luckily there are smart people on the Internet such as the creator of FireBug. Firebug let’s you debug and analyze the client side execution of your website. Also, there are other tools such as Visual Studio where you can debug the Javascript execution from within the development environment.

Unfortunately, the above tools require that you to do the test and the debug of the web app by yourself. What if you want to debug your users’ behaviors?

In this blog post I will show simple example where you can debug your web app behavior using simple print statements. These print statements (debug statement) will be sent through a partial post back to the server where it will be logged. If you want to look at more sophisticated solutions you can listen to Emre Kiciman where he introduces a tool he is working on which performs a set of analysis procedures to your javascript by rewriting the javascripts and inject debug statements in them.

One possible way is to make a javascript debugger that simply sends a debug messages to the server though AJAX call. Something similar to this

JavaScriptDebugger.debug(”This is nawaf”); - Note we are using Object Oriented Javascript code style !!!!

In the server log you will get

<JavaScript Debugger: 2009-02-09 01:04:26.197> <This is nawaf> <Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)>

The java script Debugger is a simple JQuery method that sends the debug message to a listener (Simply a servlet as attached )

/*****************************************************************/
// JavaScriptDebugger CLASS
/****************************************************************/

// This is java script debugger class that allow developers
// to debug java scripts on the user browser.
var JavaScriptDebugger = {
// This is the url where a listener is waiting for the debug statement to reach.
url: "/core/util/JavaScriptDebugServlet",

// Debug function that takes a text value as input and sends it to the server through AJAX call
debug : function(value)
{
$.post(this.url, {
javaScriptDebugMessage: value
}, function() {
alert('Your message has been logged.');
});
}
};

You need to add a mapping entry in your Web.xml just like this

<servlet>
<servlet-name>JavaScriptDebugServlet</servlet-name>
<servlet-class>sketch.core.util.viewcontrollers.JavaScriptDebugServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>JavaScriptDebugServlet</servlet-name>
<url-pattern>core/util/JavaScriptDebugServlet</url-pattern>
</servlet-mapping>

Hope this helps :)

Attachments:
javascriptdebugservlet.java
javascriptdebugger.js
jquery.js

Categorized under: Sketch

1st International Conference Communication Technologies & Social Change

ads02_11_03_2009_main Riyadh city is full of events these days. Especially those related to Information technology. This event is rather different; Social Network and activities are starting to find their way in Saudi society. Communication Technologies & Social Change is a new conference to be held at KSU Hammad Al-Jaser Hall from 15-17 March 2009.  The conference objectives can be summarized in  the following points

  1. To identify new communication technologies and its role in developing communication media.
  2. To highlight the effects of communication technologies in media, society, education, and politics.
  3. To investigate the effects of social environment on the use of communication Technologies.
  4. To clarify the relationship between communication Technologies, cultural identity and knowledge gap.

Hope to see you there :)

Categorized under: Sketch

Microsoft DevDrive Event

Sketch is attending the Microsoft DevDrive event.

Just like the best racing drivers depend on the latest and most advanced technology to maximize their performance, you too need the right tools and technologies in order to stay ahead.

Gain insight into the latest technological advances and tools like Visual Studio Team System, .NET 3.51 (including ASP.NET 3.51, WPF 3.51), Silverlight and Expression. Discuss topics like next-generation web applications, innovative designs, rich user experience, Windows Communication Foundation and Internet Explorer 8. Learn how to use technology to increase your customer usage, satisfaction and impact the bottom line

Location:
March 11th at Al-Yamama University, Riyadh

Want to meet us?
If you would like to meet our team, please call us on 0504276792

Update

This is some of the pictures that we took during the event

DevDrive2009_1 DevDrive2009_2

Categorized under: Sketch

Second National Symposium of Information Technology

Sketch team attened the the Second National Symposium of Information Technology on last Sanudy. The symposium aims to compile information technology and communications companies with academics and researchers in this field and leverage collaboration between academics and the companies.

We were excited about the number of attendees and the variety of topics that were discussed on this event. If you would like to meet us, we will be attending tonight keynote. You can reach us on 0504276792

Categorized under: Sketch

Welcome to Sketch

Sketch is a company that was formed by experts in the area of Information Technology (IT) to meet the increase need of IT solutions in Saudi Arabia. With a deep experience in the area of application development and customization , we are able to deliver topnotch solutions within time and within the scope of the client budget. Our area of experience range from standalone application development to web based enterprise solutions and open source customization

In this blog we will be writing all posts related to the company achievements and the staff publications. Since we are technical in the heart, most of the posts will have focus on technology.