Tech Insight !

Technical blog on ASP.Net, PHP, Web Development, Web hosting , Database Programming
Home » Archive by category 'Web Developement'

Combine/Compress/Minify JavaScript, CSS in Asp.net

Introduction:

When we design and develop the website, the performance is in the core of development. The system you are developing must produce the result with high speed. For the web development perspective, website load performance is very essential thing to take care of. You need good working layout, easy layout and easy navigation.

Here with this article I m not going to talk about of all the aspects of web application performance improvements. But I am specifically targeting the topic when it comes to the CSS and JavaScript faster loading in the client browser. In fact Google is also counting the speed of your website site when indexing to your website.

The goal was to improve overall performance on the client side. At the same time, it will show how we can force a client side script to be coached at the browser, so that in subsequent visit, it will take those scripts from the cache. This becomes increasingly important when using AJAX techniques within an application that introduce new features and functionality.

First of all I will outline the requirements and essential steps that this project is made of. So that if you want to implement the same in your development, it become easy for you to set up project.

To download complete project, click here

Setup:

To begin with, we will have following list of files to be created in the development studio.

  1. 2 XML files, first one to hold source of JS files for each page and second to hold CSS files for each page.
  2. A generic class that implement IHttpHandler, that will be used to delivery combined and compressed JavaScript/CSS at the client.
  3. And at last your .ASPX file that will be used to serve combined and compressed Javascript/CSS at client side.

Step by Step Implementation:

Now let’s get dig into the actual development. To summarize, let’s say we have a page default.aspx that has following no. of JavaScript files and CSS files. Think of these file that we wanted to combine them and deliver at one go at the client browser.

  1. jquery.js
  2. script-file-1.js
  3. style-1.css
  4. style-2.css

As you can see, we have 2 different JavaScript file & 2 CSS files. So what basically we will do in the next is to create a utility which can combine given JavaScript and compress it, then send it to client browser. Next the same process will be done for the CSS. Both the CSS files will be combined and compressed and send to client browser.

Now it’s time to take a look at into actual stuff that does this underlying work.

First of all we will create a CS class file that will hold the programming stuffs.

So perform the following steps to create & configure that CS class file.

  1. Create CS class file with the name ScriptCombiner.cs and put the following code in that.

public class
ScriptCombiner : IHttpHandler{

private readonly static TimeSpan CACHE_DURATION = TimeSpan.FromDays(1);

private HttpContext context;

public void ProcessRequest(HttpContext context){

}

public bool IsReusable{

get { return true; }

}

}

As you can see, we are implementing the IHttpHandler interface.

You can write custom HTTP handlers to process specific, predefined types of HTTP requests in any Common Language Specification (CLS) compliant language. Executable code defined in the HttpHandler classes, rather than conventional ASP or ASP.NET Web pages, responds to these specific requests. HTTP handlers give you a means of interacting with the low-level request and response services of the IIS Web server and provide functionality much like ISAPI extensions but with a simpler programming model.

We are also implementing IsReusable properly as it is compulsory to implement as a part of inheritance of IHttpHandler interface.

Now, let’s put the nuts & bolts inside the ProcessRequest function. I will also explain you the step by step each execution that is inside this function.

  1. We will also create another CS class file that is used to compress JavaScript. That file is named as “JavaScriptMinifier.cs”. Please take a look at the attached project solution file. As it is contain long lines of code, I can’t put it here.
  2. Complete your class file with following functions.

public void ProcessRequest(HttpContext context)

{

string xStrType, xStrSet, xStrVer, xStrpagecode;

Boolean xBlnCanCompress;

this.context = context;

HttpRequest request = context.Request;

xStrType = (!String.IsNullOrEmpty(request["type"])) ? request["type"] : null;

xStrSet = (!String.IsNullOrEmpty(request["s"])) ? request["s"] : null;

xStrVer = (!String.IsNullOrEmpty(request["v"])) ? request["v"] : null;

xStrpagecode = (!String.IsNullOrEmpty(request["pcode"])) ? request["pcode"] : null;

//first check if client browser can support compressions

xBlnCanCompress = CanClientGZip(request);

using (MemoryStream memStream = new MemoryStream(8092))

{

Stream writer;

//if browser is supporing GZip compression then create a new object using ICSharpCode.SharpZipLib.GZip

//library which allow the compressed respose to send to client

if (xBlnCanCompress)

writer = (new ICSharpCode.SharpZipLib.GZip.GZipOutputStream(memStream));

else

writer = memStream;

using (writer){

//now its time to read all the script/css files into a StringBuilder object.

StringBuilder combinedSource = new StringBuilder();

foreach (string file in GetFileNames(xStrSet, xStrpagecode, xStrType))

combinedSource.Append(System.IO.File.ReadAllText(context.Server.MapPath(file), Encoding.UTF8));

//Upto now we have combined all css/javascript based on request.

//its now time to remove extra white spaces and other unwanted characters from respose.

//compression will take place now.

string minified;

//use the YUI Javascript/CSS minifier to compress all js files

if (xStrType == “js”)

minified = combinedSource.ToString();

else

minified = CompressCSS(combinedSource.ToString());

// Send minfied string to output stream

byte[] bt = Encoding.UTF8.GetBytes(minified);

writer.Write(bt, 0, bt.Length);

}

//cache the respose so that in next request it can be reused

byte[] responseBytes = memStream.ToArray();

//context.Cache.Insert(GetCacheKey(xStrSet, xStrType, xStrVer, xBlnCanCompress), responseBytes, null, System.Web.Caching.Cache.NoAbsoluteExpiration, CACHE_DURATION);

// Generate the response

this.WriteBytes(responseBytes, xBlnCanCompress, xStrType);

}

}

private bool CanClientGZip(HttpRequest request){

string acceptEncoding = request.Headers["Accept-Encoding"];

if (!string.IsNullOrEmpty(acceptEncoding) &&

(acceptEncoding.Contains(“gzip”) || acceptEncoding.Contains(“deflate”)))

return true;

return false;

}

// helper method that return an array of file names inside the text file stored in App_Data folder

private static string[] GetFileNames(string setName, string pagecode, string type)

{System.Xml.XPath.XPathDocument doc2;

System.Xml.XPath.XPathNavigator navigator;

System.Xml.XPath.XPathNodeIterator iterator;

System.Collections.Generic.List<string> scripts = new System.Collections.Generic.List<string>();

string key;

if (type == “js”)

key = “scriptfile”;

else

key = “cssfile”;

if (System.Web.HttpContext.Current.Cache[key] != null)

{doc2 = (System.Xml.XPath.XPathDocument)System.Web.HttpContext.Current.Cache[key];

}

else

{

string filename;

filename = System.Web.HttpContext.Current.Server.MapPath(String.Format(“~/App_Data/{0}.xml”, setName));

doc2 = new System.Xml.XPath.XPathDocument(filename);

System.Web.HttpContext.Current.Cache.Insert(key, doc2, new System.Web.Caching.CacheDependency(filename), DateTime.Now.AddMinutes(60), TimeSpan.Zero);

}

navigator = doc2.CreateNavigator();

if (type == “js”)

iterator = navigator.Select(“/scripts/page[@pagecode='" + pagecode + "']/script”);

else

iterator = navigator.Select(“/styles/page[@pagecode='" + pagecode + "']/style”);

while (iterator.MoveNext())

scripts.Add(iterator.Current.InnerXml);

return scripts.ToArray();

}

private string GetCacheKey(string type, string setName, string version, bool cancompress)

{

return “HttpCombiner.” + setName + “.” + type + “.” + version + “.” + cancompress;

}

private void WriteBytes(byte[] bytes, bool isCompressed, string type)

{

HttpResponse response = context.Response;

response.AppendHeader(“Content-Length”, bytes.Length.ToString());

if (type == “js”)

response.ContentType = “application/x-javascript”;

else

response.ContentType = “text/css”;

if (isCompressed)

response.AppendHeader(“Content-Encoding”, “gzip”);

else

response.AppendHeader(“Content-Encoding”, “utf-8″);

context.Response.Cache.SetCacheability(HttpCacheability.Public);

context.Response.Cache.SetExpires(DateTime.Now.Add(CACHE_DURATION));

context.Response.Cache.SetMaxAge(CACHE_DURATION);

response.ContentEncoding = Encoding.Unicode;

response.OutputStream.Write(bytes, 0, bytes.Length);

response.Flush();

}

public static
string GetScriptTag(string setname, string pageid, string type, string ver)

{

string result = “”;

if (type == “js”)

result += String.Format(“<script type=\”text/javascript\” src=\”/” + Web.Utility.Functions.GetURLPrefix() + “ScriptCombiner.axd?s={0}&v={1}&type=js&pcode={2}\”></script>”, setname, ver, pageid);

else

result += String.Format(“<link link href=\”ScriptCombiner.axd?s={0}&v={1}&type=css&pcode={2}\” rel=\”stylesheet\” type=\”text/css\”/>”, setname, ver, pageid);

return result;

}

public static string CompressCSS(string body)

{

body = Regex.Replace(body, “/\\*.+?\\*/”, “”, RegexOptions.Singleline);

body = body.Replace(” “, string.Empty);

body = body.Replace(Environment.NewLine + Environment.NewLine + Environment.NewLine, string.Empty);

body = body.Replace(Environment.NewLine + Environment.NewLine, Environment.NewLine);

body = body.Replace(Environment.NewLine, string.Empty);

body = body.Replace(“\\t”, string.Empty);

body = body.Replace(” {“, “{“);

body = body.Replace(” :”, “:”);

body = body.Replace(“: “, “:”);

body = body.Replace(“, “, “,”);

body = body.Replace(“; “, “;”);

body = body.Replace(“;}”, “}”);

body = Regex.Replace(body, “/\\*[^\\*]*\\*+([^/\\*]*\\*+)*/”, “$1″);

body = Regex.Replace(body, “(?<=[>])\\s{2,}(?=[<])|(?<=[>])\\s{2,}(?=&nbsp;)|(?<=&ndsp;)\\s{2,}(?=[<])”, string.Empty);

return body;

}

You are now almost done with 50% of work for your project.

Now let’s take a look at the few of important execution steps that are in this function.

First of all we are declaring four different string variables:

string xStrType, xStrSet, xStrVer, xStrpagecode;

They will be used to get the Querystring passed in to this handler. This is utilized later on the code.

Moving next, you will find these function call:

//first check if client browser can support compressions

xBlnCanCompress = CanClientGZip(request);

This is basically to check does client browser support GZip compression.

Gzip compression, otherwise known as content encoding, is a publicly defined way to compress textual content transferred from web servers to browsers. HTTP compression uses public domain compression algorithms, like gzip and compress, to compress XHTML, JavaScript, CSS, and other text files at the server. This standards-based method of delivering compressed content is built into HTTP 1.1, and most modern browsers that support HTTP 1.1 support ZLIB inflation of deflated documents. In other words, they can decompress compressed files automatically, which saves time and bandwidth.

In the next step it is preparing the stream object used to hold the response output. We will not take dipper look into that code. As I expect that the a beginning developer even must be able know about next few line of code. J

Let’s move to the line of code:

//now its time to read all the script/css files into a StringBuilder object.


StringBuilder combinedSource = new
StringBuilder();

foreach (string file in GetFileNames(xStrSet, xStrpagecode, xStrType))

combinedSource.Append(System.IO.File.ReadAllText(context.Server.MapPath(file), Encoding.UTF8));

As you can see in the foreach loop, it is calling to method GetFileNames, by passing 3 different parameters. Here this is also core and important part of this project. Let me outline you first what this function basically do. This function will read to the “script.xml” file that hold content of script file that we want to load. Please look inside the attached project solution to understand it better. The function will read xml file and return array of string object containing JavaScript files to read.

In the subsequent line of code, it iterate through each file name and read it. Each content of read file is placed inside a StringBuilder object.

Please take look at the code inside the GetFileNames function to understand what is actually happening inside it. It fetches the JavaScript/CSS based on the parameter passed. And return either the JavaScript file name array or CSS file name array.

So now we have a combined script/CSS with us. It’s a time to minify JavaScript/CSS now.

Following line of code will minify respective JavaScript/CSS based on type of client script requested.

//use the YUI Javascript/CSS minifier to compress all js files


if (xStrType == “js”)

{

JavaScriptMinifier minifier = new
JavaScriptMinifier();

minified = minifier.Minify(combinedSource.ToString());

}

else

{

minified = CompressCSS(combinedSource.ToString());

}

The JavaScriptMinifier has been created in the 2nd step. Please refer to the attached solution project for more detail regarding this class file. I have adopted this class file from one of the article

You will also see function CompressCSS that is used to compress CSS file. The compressor of CSS file is done through just few regular expression. JavaScript compression has different algorithm.

After that it is calling to WriteBytes function that will prepare the combined & compressed JavaScript & CSS response and send it to the client.

Hurray… as part of implementation we are done.

Now it’s time to check that in action. You can run the project attached here with and check it In live action.

To download complete project, click here

Let’s compare the result of two different pages. The first one is with the compressed JavaScript & CSS. The second one is with the normal JavaScript & CSS. We will also see the difference in load time and size of content received.

Response time with compressed JavaScript & CSS.

Response time without compressed JavaScript & CSS.

As you can see from given statistics

With Combined & Compressed JavaScript and CSS ..

Total request: 3

Response size: 16.3 KB

Without Combined & Compressed JavaScript and CSS ..

Total request: 5

Response size: 96 KB

You can clearly see the difference between these two request.

To get more idea open and run the project yourself. That will give you better idea.

Hope you will find it very useful.

Happy coding…. J

NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

Implementing JQuery Model Popup Plug-In and Playing FLV file in a model popup

Implementing J-Query Model popup Plug In

As shown in above screen, developing Model Popup will require 2 layers:

  1. Disabled Back ground
  2. Popup content Panel

We will implement a plug In and call it on Popup Panel element.

Somewhat like: $(“div.popupDiv”).ShowPopup();

ShowPopup();
Is a plug-In method which will initiate an instance of the plug-In which we going to implement as next step.

Prior to that a CSS for Disabled background needs to be developed

Which we can achieve as below:

.popupbackGround

{

position: absolute;

height: 100%;

width: 100%;

left: 0px;

top: 0px;

background-color: #000;

z-index: 1;

opacity: 0.5;

filter: alpha(opacity =50);

display: none;

}

We don’t have to assign this CSS class anywhere in HTML, but we will use this class while implementing Plug-In.

Next to this, we will implement Model Popup J-Query Plug-In.

Parameter to be passed to Plug-In: closeButtonCSS

The plug in will be called on the popup panel itself and take one parameter called CloseButtonCSS which will be used to close the Model popup.

We will create close event on the specified close button in parameter.

model-popup.js (Plug-In file)

jQuery.noConflict();

(

function($K){

$K.fn.ShowPopup=function(data)

{

/*

Parameters:

closeButtonCSS,

*/

$K(this).each(function(i)

{

var dbBack,intTopAxis=0;

var objCloseButton= $K(“.” + data.closeButtonCSS);

var objPopup= $K(this);

var a;

objCloseButton.click(function(){

HidePopup();

});

$K(window).scroll(function()

{

var xTop= parseInt($K(window).scrollTop()) + intTopAxis ;

objPopup.animate({top:xTop+ “px”},{queue: false, duration: 350});

});

initBackGround = function()

{

dbBack  = $K(“<div></div>”).attr(“class”,“popupbackGround”).css(“height”,$K(document).height()).hide();

$K(“body”).append(dbBack);

intTopAxis= parseInt(($K(window).height())/2)-(objPopup.height()/2);

}

ShowPopup = function()

{

initBackGround();

dbBack.fadeIn(function(){objPopup.show();});

objPopup.css({“left”: (($K(window).width())/2)-(objPopup.width()/2),“top”: (($K(window).height())/2)-(objPopup.height()/2)+parseInt($K(window).scrollTop())}) ;

}

HidePopup = function()

{

objPopup.fadeOut();

dbBack.fadeOut();

}

ShowPopup();

});

}

})(jQuery);


How to call Model Popup

Popup Plug-In can be called on any Div object. And the DIV itself will get displayed as a popup like shown in the above screen.

For example:

Target popup DIV class is popupDiv.


<div class=”popupDiv”>

<div>

Popup Content Goes Here..

</div>

<div class=”close”><class=”lnkClose”><img src=”resource/small-closelabel.gif” /></a>

</div>

</div>

We can popup by placing the following javascript :

$k(“div.popupDiv”).ShowPopup(

{

closeButtonCSS:“lnkClose”

});

Here “closeButtonCSS:“lnkClose” is used to treat lnkClose as close button of popup.

Playing FLV

To play any FLV file in HTML will require a flash based FLV player. There are many FLV players available among of those we will use one, which is a flash file and we can play FVL using the flash FLV player.

Here we will require 2 flash (SWF) files:

  1. flvplayer.swf (download )
  2. SteelExternalAll.swf (needs to be placed on same path of container HTML page) (Download)

Below is how to embed object in HTML page to play FLV using above FLV player.

<object id=”Object1″ height=”380″ width=”400″ classid=”clsid:D27CDB6E-AE6D-11cf-96B8- 444553540000″ codebase=”http://macromedia.com/cabs/swflash.cab#version=6,0,0,0″>

<param name=”movie” value=”flash/flvplayer.swf” />

<param name=”FlashVars” value=”flvurl=../flash/test.flv” />

<param name=”quality” value=”high” />

<param value=”true” name=”autoplay” />

<embed height=”380″ width=”400″ src=”flash/flvplayer.swf” flashvars=”flvurl=../flash/test.flv” type=”application/x-shockwave-flash” />

</object>

Above code will take FLV file path as a parameter, that is been specified at 2 places.

  1. flashvars=”flvurl=../flash/test.flv”
  2. <param name=”movie” value=”flash/flvplayer.swf” />

Your FLV file path will go here.

Putting all together

Now we got both things ready with us.

  1. Implemented J-Query plug-In for model popup
  2. FLV player

Simply placing the <object> tag inside the Popup Div will result in our targeted output.

In addition to that we will require a Button to be clicked to show model popup. Like shown below

<a class=”lnkPopup”>Play FLV in Popup</a>

Let’s create a simple J-Query click event of the above link and call popup plug-In inside click event, like shown below.


<script type=”text/javascript” language=”javascript”>


var $k=jQuery.noConflict();

$k(document).ready(function()

{

$k(“a.lnkPopup”).click(function()

{

$k(“div.popupDiv”).ShowPopup(

{

closeButtonCSS:“lnkClose”

});

});

});

</script>

You can also download full source code ZIP file by clicking here .

NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

Utilizing CSS3 features: Creating interactive and optimized HTML form using CSS3 selectors

March 9th, 2010 Posted in CSS 3, HTML, Web Developement Tags: , ,

CSS3 gives a great flexibility to designers to create optimized HTML by utilizing CSS3 features.

CSS3 selectors gives rich amount of DOM element filtering, which will let designers to minimize inline attributes and inline styles in HTML code.

Here I am giving an overview of how to utilize CSS3 to develop an HTML form as shown below.

We will try to optimize HTML as much as possible by giving all styles and attributes through CSS3 in css file itself.

Form Concept:

As shown in below screen, we will be dividing form into 4 pieces,

  1. Header part (<th> )
  2. Left side labels (<td>)
  3. Right side textbox area (<td> & <input type=”text” /> )
  4. Bottom Buttons ( <input type=”submit”/> )

Generating Simple HTML form:

As shown in below HTML, we will not give any attributes to TABLE or TD.

Just a simple Table with only one class which is assigned to TABLE, like class=”tblform”. Very neat HTML without any kind of attributes assigned.

HTML file code

<table class=”tblform”>

<tr>

<th colspan=”2″>Please enter your details below.</th>

</tr>

<tr>

<td>Name</td>

<td><input type=”text” />

</td>

</tr>

<tr>

<td>Email</td>

<td><input type=”text” />

</td>

</tr>

<tr>

<td>Mobile</td>

<td><input type=”text” />

</td>

</tr>

<tr>

<td>

</td>

<td><input type=”submit” value=”Submit” /><input type=”submit” value=”Cancel” />

</td>

</tr>

</table>

Developing CSS file:

Once we got the above HTML ready, our all focus will be now on CSS to make it look like as shown in above screen shot,

In HTML there is only 1 CSS class assigned to TABLE which is tblform.

Further will be doing all stuffs in the CSS as given below,

CSS file code

.tblform{

border-collapse: collapse;

width: 100%;

font-family: Calibri;

font-size: 11pt;

}

.tblform td{

padding: 5px;

border: solid 1px #E1E1E1;

}

.tblform th{

padding: 5px;

border: solid 1px #E1E1E1;

font-weight: normal;

text-align: left;

background-color: #E1E1E1;

font-weight: bold;

}

.tblform td input[type=text]

{

border: 1px solid #CCCCCC;

width: 180px;

height: 20px;

padding-left: 5px;

}

.tblform td:first-child

{

padding: 5px;

border: solid 1px #E1E1E1;

background-color: #F2F2F2;

}

.tblform td input[type=submit], .tblform td input[type=submit]:hover

{

background-image: url(button-bg.gif);

background-repeat: repeat-x;

line-height: 22px;

height: 25px;

font-family: Verdana, Arial,Helvetica, sans-serif;

font-weight: bold;

font-size: 11px;

color: #333333;

padding: 0px 10px 0px 10px;

border: 1px solid #999999;

cursor: pointer !important;

}

That’s it, it will result in a nice form with all CSS applied and HTML will remain neat as it is.

NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

Understanding asp.net MVC (Model View Controller) architecture

This article is intended to provide basic concept and fundamentals of asp.net MVC (Model View Controller) architecture workflow for beginners.

Introduction:

“M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER” , asp.net MVC is an architecture to develop asp.net web applications in a different manner than the traditional asp.net web development , web applications developed with asp.net MVC is even more SEO (Search Engine Friendly ) friendly.

Developing asp.net MVC application requires Microsoft .net framework 3.5 or higher.

MVC interaction with browser:

Like a normal web server interaction, MVC application also accept request and respond web browser same way.

Inside MVC architecture:

Whole asp.net MVC architecture is based on Microsoft .net framework 3.5 and in addition uses LINQ to SQL Server.

What is a Model?

  1. MVC model is basically a C# or VB.net class
  2. A model is accessible by both controller and view
  3. A model can be used to pass data from Controller to view.
  4. A view can use model to display data in page.

What is a View?

  1. View is an ASPX page without having a code behind file
  2. All page specific HTML generation and formatting can be done inside view
  3. One can use Inline code (server tags ) to develop dynamic pages
  4. A request to view (ASPX page) can be made only from a controller’s action method

What is a Controller?

  1. Controller is basically a C# or VB.net class which inherits system.mvc.controller
  2. Controller is a heart of whole MVC architecture
  3. Inside Controller’s class action methods can be implemented which is responsible for responding to browser OR calling view’s.
  4. Controller can access and use model class to pass data to view’s
  5. Controller uses ViewData to pass any data to view

MVC file structure & file naming standards

MVC uses a standard directory structure and file naming standards which is very important part of MVC application development.

Inside the ROOT directory of the application there must be 3 directories each for model, view and Controller.

Apart from 3 directories there must have a Global.asax file in root folder. And a web.config like a traditional asp.net application.

  • Root [directory]
    • Controller [directory]
      • Controller CS files
    • Models [directory]
      • Model CS files
    • Views [directory]
      • View CS files
    • Global.asax
    • Web.config

Asp.net MVC Execution life cycle

Here is how MVC architecture executes the requests to browser and objects interactions with each other.

A step by step process is explained below: [Refer figure as given below]

Step 1:
Browser request

Browser request happens with a specific URL. Let’s assume that user entering URL like: [xyz.com]/home/index/

Step 2: Job of Global.asax – MVC routing

The specified URL will first get parsed via application_start() method inside Global.asax file. From the requested URL it will parse the Controller, Action and ID.

So for [xyz.com]/home/index/:

Controller = home

Action = index()

ID = empty — we have not specified ID in [xyz.com]/home/index/, so it will consider as empty string

Step 3: Controller and Action methods

MVC now find the home controller class in controller directory. A controller class contains different action methods,

There can be more than one action method, but MVC will only invokes the action method which is been parsed from the URL, its index() in our case.

So something like: homeController.index() will happen inside MVC controller class.

Invoking action method can return plain text string OR rendered HTML by using view.

Step 4: Call to View (ASPX page)

Invoking view will return view() . a call to view will access the particular ASPX page inside the view directory and generate the rendered HTML from the ASPX and will respond back to the browser.

In our case controller was home and action was index(). So calling view() will return a rendered HTML from the ASPX page located at /views/home/index.aspx.

This is it, the whole process ends here. So this is how MVC architecture works.

NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

Why do we engineer web?

Introduction:

To understand the necessity for web engineering, we must pause briefly to look back at the recent history of computing. This history will help us to understand the problems that started to become obvious in the late sixties and early seventies, and the solutions that have led to the creation of the field of software & web engineering. These problems were referred to by some as “The software Crisis,” so named for the symptoms of the problem. The situation might also been called “The Complexity Barrier,” so named for the primary cause of the problems. Some refer to the software crisis in the past tense. The crisis is far from over, but thanks to the development of many new techniques that are now included under the title of software engineering, we have made and are continuing to make progress.

Although the topic I have written on is about very tiresome, even thought the importance of web/software engineering is very essential in all parts  development life cycle. It’s all about making your development process more sophisticated and well documented.

Let me first of all outline you the agenda which I am going to explain in this article.

  • Nature of web/software project
  • Engineering approach
  • Software/web process
  • A process steps
  • Characteristics of a good process
  • Role of waterfull model in the development
  • Project planning

First of all we will see the different kind of software or web. How they affect in the day to day life of human being. It may be different complexity, from the different domain.

Next we will examine the different engineering approach that we can apply on our development process. Generally we understand the engineering is of field civil, mechanical, architectural etc. But engineering approaches can also be used in the development process to make it more simpler.

Then after we will take a look at the different software engineering process models available. We will then define the a practical software process steps and then we will also examine the characteristics of a good software process.

Nature of web/software project

We encounter may software or web application in the our day to day life. It may be of different domain, it may be simple, it can a large enterprise portal or can be a scientific for purpose.

Typically the nature of a software system can be:

  1. Ubiquitous, used in variety of area
    Business, engineering etc.
  2. It can be simple to complex, internal or public, one location centric or distributed, real time, information purpose, help desk etc.

Now there are many major challenges in the life of development process. Our main intension of this article is to outline the different kind of hurdles that a software developer or manager encounter in the development. They are as per below:

  1. Effort intensive
  2. High cost
  3. Continuous and log development
  4. User requirements frequently changes
  5. Risk of failure that can be performance issue, unable to accept response of user, maintainability of project etc.

Some time web projects or say any software project involves the high cost. The software analyzers sometime fail to identify software cost properly. Sometime the development get so stretch that it start becoming very costly. The management is mostly always concern with the quick and cheap solution. Due to the more and more money invested in web development and the outcome is not produces or is not upto to satisfaction as it should be.

Personally I feel that in most of development of either a web based project or enterprise application, the user’s continues changing requirement never ends. In any project, the end user is the one who is going to give final review. Software engineers do make requirement engineering, but the due to many factor user’s requirement keep on changing. Those factory may be managerial, market competition, changing in the government laws, marketing strategy etc. Because of these the user’s requirement get changed.

Sometime everything goes well but when the final outcome of software/web project get released, it does not satisfy the user. The performance may not be upto the mark. The end user is not concern with the technical issue involved in development. They only concern for the quick and accurate output.

So these are the few hurdles that any software engineer or manager face in his past experience life.

So when can we say that software is successful:

  • Software project have not always been successful.
  • When do we consider a project is successful
    • Development completed
    • It is useful
    • It is usable
    • It is used
  • Software should be cost effective & maintainable

To be build up any successful software, it need to under go many engineering process. I don’t mean to say that  the engineering process of big science/construction engineering. Engineering Is a set up well defined process steps. By following those well defined projects you can build up successful software.

Now lets consider what are the reason of failure for making this project successful.

  • Schedule slippage
  • Cost goes over
  • Does not fulfill user’s requirement
  • Poor quality

So this are the basic criteria which lead a project toward unsuccessful.

Now let’s consider that what are the reasons that lead to such failure.

  • Unplanned development
  • The milestones and deliverables are not identified
  • User requirement changing/poor understanding user’s requirement.
  • No review control
  • Technically the team is not matured
  • Unsuccessful planning of cost by user & developer.

If you can’t plan, you can’t reach to success. I personally feel during my experience life time that the unplanned work is always been major factory in the failure of software. The unplanned development may include anything from un proper utilization of human resources, the developer are forced to keep on changing on different projects, client’s continues changing in requirement etc. These all and in fact many other unplanned factors lead to software failure.

Let’s think that you are a smart developer who plan for all his work before he actually going to implement. Then in that case if the deliverables or milestones are not defined, we would not be able to judges the progress of development. Milestones/deliverables are most important in the development cycle. They tells about the progress of development. It help you to identify set up next goal in development.

Requirement engineering is one of the most crucial part in development life cycle. It is always been hard to identify and model user’s requirement. If the user’s requirement is not identified properly then the development can’t proceed further.

Constant review or control is also important part of development. The inspection and review is heart in the quality assurance. The development need to be monitored by the supervisor so that we can actually come to know how the development is going.

The developer need to be constantly updated with the latest tools and technology. Sometime the company have the projects, but they do not have such experienced or skilled resource, due to which they postpone their effort in getting such projects. Nowadays the technology is keep on changing. So many tools and technology are emerging which can really solve your many development issues. The open source platform is one of the great example. There are thousand of scripts and tools are available over the internet that a web developer can learn and implement. The developer need to be in touch with different community sites and build up their knowledge bank.

So these is what I want to tell about why we engineer the web/software. If we want to overcome those issue we really need to implement those software engineering and development process in our development.

So you will say that this is the end of my talk. No, I further want to tell you something regarding the engineering terms. After reading that much, you are really free to go by leaving your seat.

“Engineering” a solution:

According to the definition given by the professor Sarda(IIT Bombay), an engineering is: To design, develop an artifact that meets specification efficiently, cost-effective and ensure quality.

Why the other engineering projects are successful than the software?

So to understand the reason of that, lets first go through what a large engineering project is made up of.

  • Involve different type of peoples
    Building project: civil engineers, electrical engineer, architects, workers etc.
  • Continuous supervision for the quality assurance.
    On site supervisor
  • Many deliverables: architecture plan, model, structure diagrams, electric cabling etc.
  • Standards need to be followed
  • Steps and milestone are defined, reviewed and we proceed further. So the visibility of development is important aspect.

But the software engineering approach is somewhat different than these. Software architecture and planning is not same as the other engineering projects.

I will make you introduce with rest of discussion in my next series of articles.

So have a good time and have a productive coding.

NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

Recommendation for developers

Generally, and most often many developer ask following normal questions:

  1. “What do I do so I can become a full time web developer?”
  2. Experienced developers often ask what I would recommend to help advance their careers or become an independent

These answers are not easy…it depends on your experience, your available time, and most importantly, your drive. The first 5 are for those of you just getting started and the last 5 are for the life of your career.

  • Find Good Resources – Whether it’s a friend, colleague, website forum or some online community, try to find at least one good resource. When I graduated college, most of my skills were web development related technologies. Specially .net 2.0 technology, ASP, VB, Sql Server and all that. My initial interest was on the networking side. Later on I switched to programming and keep continue in that field. The most important advice would tell is to be in contact with your seniors. Your senior have vast amount of experienced behind them, which can really drive you a good path. I was always used to be in contact with my one of senior. And in fact I got inspiration from him only to go for the .net development. I developed a couple ecommerce sites and keep on learning on different web development technologies. Specially I also love the dealing with SQL. So did few of certification also in that.
  • Learn the Basics – All most in your every line of code you write, your most common tasks will include declaring variables, assigning values, performing calculations, looping through data, if…then…else, functions, etc. Every language supports these features and they must be mastered. Any “Introduction” book will cover these features in very good detail. If a book has at least a dozen reviews, see what the consensus says. Better yet, a good resource should be able to recommend a good starter book. I also highly recommend buying an introduction book for the language you plan on developing in. You might not know what that is, but you should have a good idea. You want to always be reading in the language you are learning…this may seem obvious, If you want to learn C#, make the investment of buying a good C# book. And don’t worry too much about choosing a language to start with…as I said above, the basics translate to any language…it’s just differences in the syntax.
  • Follow the KISS Rule (Keep It Simple Stupid) – May time I come across such issue where developer are involved in doing the changes in others work. When it come to modify some else programming, it become very tedious task to do. First any one need time to understand the logic implemented by others. If you put 1,000 programmers in a room and gave them even a simple coding task, not one person would code it the same. The question is, would everyone be able to read your code…and if you looked at it a few months later, would you be able to quickly read and understand it? There are a million ways to solve any problem; the best approach is to keep it simple. It makes it much easier to maintain and also decreases the chance of someone else breaking it.
  • Test Your Learning By Implementing it – Reading and comprehending a subject isn’t that difficult….but can you really apply what you just learned? I have seen many peoples who can read for the hours and hours. But when you ask them what did he learned, he would be unanswered. I have a wonderful thought, that says: “What you see has no meaning when you don’t read it. It has no meaning of what you read until you understand it, and there is no important what you understand until you implement it”
  • Plan your Code – Oh.. that’s real main important that I should more focus on, during my job I see many developers, in fact almost everyone are used to start coding straightway when they are given with specific module. Developer do not plan their coding before they begin it. They are generally very excited about development when they get something new to do. But that’s the not proper approach. It always lead to big mistakes. It either make you to long development time or I may lead to wrong development at the end. The very fundamental development life cycle approach MUST be followed. And that is called System Development Life Cycle (SDLC).
    • Project planning and feasibility study: Establish a high-level view of the project and determines its goals.
    • Systems analysis and requirements definition: Refine goals into defined functions. Analyze end-user needs.
    • Systems design: Describe desired features in detail, including screen layouts, business rules, process diagrams and other documentation.
    • Implementation: Write the code. Personally, I design the database first,
    • Testing: Check for errors, bugs.
    • Deployment: The final stage of the initial development where the software is put into production and runs the actual business.
    • Maintenance: The rest of the software’s life: changes, correction, additions, moves to a different platforms, etc. This, the least glamorous and perhaps most important step of all, goes on seemingly forever.
  • Laziness Will Kill You! – Often, you might seem under a lot of pressure to get something done very quickly…it is very important to never compromise the quality of the software to get something done fast. At least a half dozen cases where a fellow developer did not code for some scenario because “there’s no way anyone would ever do that”. And more times than not, some user somewhere did it…and I’ve seen entire websites crash because of it (and people do get fired). The developer always blames the user for being stupid and doing what should not have been done, when in fact the developer is the real idiot. Don’t be lazy…don’t be a hack…do it right.
  • Put First Things First – Stephen Covey’s “7 Habit’s of Highly Effective People”. He says in Habit 3: Put First Things First, “The key is not to prioritize your schedule, but to schedule your priorities. Do the most important things first – because where you are headed is more important than how fast you are going”. He also says of all of the 7 habits, this is the hardest one to master. I completely agree…it is so easy to work on the fun tasks or prioritize what may seem urgent over working on the not-so-fun things than require time and serious thought. But what’s important should always take precedence over what’s considered urgent. In Covey’s book, he also referenced a lifelong study on what the common trait among successful people is. The answer: successful people know to “Put First Things First”. This may be the most important recommendation you’re your continued career.
  • Prepare Component for Reusability – You should never need to rewrite the same logic of code ever. Does your application send emails out? If so, you better have one “SendEmail” method that everyone uses. Do you query the database for the current specials to be displayed on every page? You better have that method encapsulated in a database tier and every page better be getting the data through that method (Better yet, you better be caching that data to eliminate the extra database queries!). Whenever I m supposed to start development in any of new project, I first try to find out the common functionality or functions that need to be developed across different web pages. Generally I devide them into different set of segments. Say for e.g. for the task related to validation at the client side, I always has a dedicated .js file which contain all most common validation functions. Same concept I applied to the database programming. We had developed a specialized library that do the all the basic CRUD operation. We have followed the MS Petshop application pattern. In this, we generally have to prepare the object of models and pass it to the data layer. The data layer will do the rest of database related operation.
  • Certifications –Does certification puts wings on your resume..?? No, that is not always true. Most people says getting certified is a good idea. But few completely disagree. The main disagreement is that anyone can get certified. They’re just tests and there are “brain dump” websites out there where people post questions and answers right after taking the tests. But generally companies may or may not consider your certifications that you highlighted on your resume. Yes that is true, that it sometime attract to the recruiter or the HR. They may prioritize your changes first in getting hire a developer. But even after they are going to follow the same selection process that they are used to do. They are gonna take your personal technical interview, may take technical exams. So by that way, if you are not upto the mark in your certification, then you are gone. They do not give discount in selection process to certificate holders. But at the end it is certification is eye attraction :-)
  • Continued Education – Each developer know enough to get the job done, work their 8 hours every day and go home to do nothing. Those with drive and ambition to be great continue their education everyday…even at home. Whether it’s reading technical magazines, online articles, blogs, or picking up a good book, anything you do to stay on top of the latest technology will give you a huge advantage. Not only will you continue to work with the latest software, but you will also be much more sought after, have much better job security and be able to bill a much higher rate. My favorite site is The Code Project, C# corner and may different blogs. When searching for a way to do something specific, I often go here first and almost always find it. Whatever approach you take, make a conscious effort to keep learning. By being smarter and better than the rest, And yes keep on developing your knowledge bank database by bookmarking important resources that you come across while surfing over the net. This will really help you out to get the quick solution in what you do.



NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

Custom error tracking library in asp.net using XML & C#

Being an asp.net developers we develop a web project and get it completed in a months of time as there are many organizations which works on very tight bound timeline for developing web sites Or web application projects. And delivers the project to client in months of time

While after project delivery if client come up saying that they are facing problems or application is giving errors, that time it always becomes a headache for a developer to test each things even whole project sometimes to find a smaller errors (by means of error here we are not talking about logical errors, we talking about exceptions which mostly responsible for errors in the application), there are many exceptions .net framework fires which we never come to find out while debugging or developing the application. Those exceptions never affect directly to the application but each small exception puts the unnecessary load on the server.

Here is the solution to track each and every smallest things happening inside your asp.net web application. Which I named as “Custom error tracking library

Custom error tracking library

Very first question will come is that, what is the core concept for this.

Concept is like we will be maintaining an XML file with a predefined structure which I have built which will contain all the required fields as nodes and subs. Which we call as errorlog.xml

There will be a CS library file which will track each and every minor errors/exceptions happens inside the application or .net framework and will put the error details inside the XML file.

Once we got CS library ready with us we just have to a simple function with 2 overload methods as per requirement in each try/catch blocks of the code and also in Application_Error event of Global.asax file.

XML File (errorlog.xml)

<?xml version=”1.0″ encoding=”utf-8″?>

<errorlog>

<error>

<datetime>datetime</datetime>

<filename>filename</filename>

<classname>classname</classname>

<methodname>methodname</methodname>

<errormethod>errormethod</errormethod>

<messsage>ErrorMessage</messsage>

<errordetails>Details goes here</errordetails>

<IP>IP adress</IP>

<url>URL</url>

</error>

<error>

</errorlog>

Root node of XLM file will be <errorlog></errorlog> inside root node there will be a sub node <error></error> which will get duplicated for each error. For each error, library will generate a node will all the below listed details in XML file. Next to last error node. So for each error there will be a seaprate ERROR node.

Each fields of the above XML file is descibed beloe :

  1. 1. Datetime : date and time of the error/exception
  2. 2. File name : file name where exception or error happens
  3. 3. Class name : classname in which error occurred
  4. 4. Methodname : function name where errored
  5. 5. Errormethod : name of the function which contains error code.
  6. 6. Message : error message/exception message
  7. 7. Error details: detailed error description which will show wholestack trace of the functional execution.
  8. 8. IP : client IP address
  9. 9. URL : absolute error ULR

CS library

There will be a CS library file where we will write all functionality for error handling and writing errors into XML file.

errorHamdler.cs file will have 2 statis methods named WriteError(), there will be 2 overloaded methods for same functions with diff. parameters.

CS file will look as given below. We name it as errorHamdler.cs

errorHandler.cs

using System;

using System.Collections.Generic;

using System.Text;

using System.Xml;

using System.Reflection;

using System.Diagnostics;

namespace code_center

{

public class errorHandler

{

string _strErrorMessage, _strDetails, _strClassName, _strMethodName;

DateTime _dtOccuranceTime = new DateTime();

public errorHandler()

{

}

public errorHandler(DateTime time, string className, string methodName, string errorMessage, string details)

{

_dtOccuranceTime = time;

_strClassName = className;

_strDetails = details;

_strErrorMessage = errorMessage;

_strMethodName = methodName;

}

public static void WriteError(Exception ex)

{

WriteError(ex, “”);

}

public static void WriteError(Exception ex, string fileName)

{

XmlDocument doc = new XmlDocument();

string strRootPath = System.Configuration.ConfigurationManager.AppSettings["logfilepath"].ToString();

string xmlPath = System.Web.HttpContext.Current.Server.MapPath(strRootPath);

doc.Load(@xmlPath);

XmlNode newXMLNode, oldXMLNode;

oldXMLNode = doc.ChildNodes[1].ChildNodes[0];

newXMLNode = oldXMLNode.CloneNode(true);

StackTrace stackTrace = new StackTrace();

StackFrame stackFrame = stackTrace.GetFrame(1);

MethodBase methodBase = stackFrame.GetMethod();

newXMLNode.ChildNodes[0].InnerText = DateTime.Now.ToString();

newXMLNode.ChildNodes[1].InnerText = fileName;

newXMLNode.ChildNodes[2].InnerText = methodBase.DeclaringType.FullName;

newXMLNode.ChildNodes[3].InnerText = methodBase.Name;

newXMLNode.ChildNodes[4].InnerText = ex.TargetSite.Name;

newXMLNode.ChildNodes[5].InnerText = ex.Message;

newXMLNode.ChildNodes[6].InnerText = ex.StackTrace;

newXMLNode.ChildNodes[7].InnerText = System.Web.HttpContext.Current.Request.UserHostAddress;

newXMLNode.ChildNodes[8].InnerText = System.Web.HttpContext.Current.Request.Url.OriginalString;

doc.ChildNodes[1].AppendChild(newXMLNode);

doc.Save(@xmlPath);

doc.RemoveAll();

}

}

}

In above code there is a line “string strRootPath = System.Configuration.ConfigurationManager.AppSettings["logfilepath"].ToString();”

We need to give XML file path also where we have placed XML file in the project, so just have to add 1 line in web.config file as given below to store actual XML file path, which will be used in abiove functon.

Code inside web.config

<appSettings>

<add key=”logfilepath” value=”~/errorHandling/errorlog.xml”/>

</appSettings>

How to use error handler in application

Now everything is ready to be used in real time application. In each try/catchblock we have to call

Writeerror() function as described below .

Code inside Default.aspx.vb

protected void Page_Load(object sender, EventArgs e)

{

try

{

throw new Exception(“Custom error”);

}

catch (Exception ex)

{

Response.Write(ex.Message);

code_center.errorHandler.WriteError(ex, “Default.aspx.vb”);

}

}

Apart from each try/catch blocks we will put some code in Global.asax file also, as given below.

void Application_Error(object sender, EventArgs e)

{

code_center.errorHandler.WriteError(Server.GetLastError().GetBaseException(), “Global.asax”);

}

The reason behind putting code in Global.asax file is very important and necessory as there might be many exceptions which occurs at application level and canot be tracable in any try/catch blocks in any function or events. So anyerror except try/catch blocks will come in this event (Application_Error) and will get inserted intoXML file.

That’s it, we have done with the error handling, and all errors will be tractable from the XML file which is being generated via the error handler.



NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

List of technology which can be adopted into development

Business Intelligence Application Development

Companies are investing millions of dollars in ERP solutions or have invested till date to improve the way they conduct their business. While ERP provides significant benefits organizations are finding that, in order to achieve critical decision making business goals, they often need to supplement it with additional external reporting capabilities for it end users. With the wealth of data entered and stored in ERP databases the ability to analyze and interpret the data is significant for management reporting. With Business Intelligence tool, it has greatly alleviated the backlog of report requests and has provided users with decision making information in a timely manner.

Business Intelligence is a method of storing and presenting key enterprise data so that anyone in your company can quickly and easily ask questions of accurate and timely data. Effective BI allows end users to use data to understand why your business got the particular results that it did, to decide on courses of action based on past data, and to accurately forecast future results.

BI data is displayed in a fashion that is appropriate to each type of user, i.e. analysts will be able to drill into detailed data, executives will see timely summaries, and middle managers will see data presented at the level of detail that they need to make good business decisions. Microsoft’s BI uses cubes, rather than tables, to store information and presents information via reports. The reports can be presented to end users in a variety of formats:Windows applications,Web Applications, and Microsoft BI client tools, such

as Excel or SQL Reporting Services.

Need for the BI application:

Check out following article where it is explain what is the important of BI application

http://www.cio.com/article/153500/Need_for_Business_Intelligence_Grows_Too_Much_Information_Not_Enough_Insight

Microsoft products involved in BI application development:

SQL Server 2005: This is the preferred staging and, possibly, source location for BI solutions. Data can actually be retrieved from a variety of data stores (Oracle, DB2, and so on), so a SQL Server installation is not strictly required to build a Microsoft BI solution. However, due to the integration of some key toolsets that are part of nearly all BI solutions—for example, SSIS or SQL Server Integration Services, which is usually used to perform the ETL of source data into the data warehouse—most BI solutions will include at least one SQL Server 2005 installation. Another key component in many BI solutions is SQL Server Reporting Services (SSRS). When working with SQL Server to perform OLAP administrative tasks, you will use the management interface, which is called SQL Server Management Studio (SSMS).

SQL Server Analysis Service: This is the core server in Microsoft’s BI solution. SSAS provides storage for the data used in cubes for your data warehouse.

SQL Server 2005 Integration Service: This toolset is a key component in most BI solutions that is used to import, cleanse, and validate data prior to making the data available to the analysis Services for reporting purposes. It is typical to use data from many disparate sources (relational, flat file, XML, and so on) as source data to a data warehouse. For this reason, a sophisticated toolset, such as SSIS is used to facilitate the complex data loads that are often common to BI solutions. As stated earlier, this functionality is often called ETL (Extract, Transform, and Load) in a BI solution.

SQL Server 2005 Reporting Service: This is an optional component for your BI solution.

Excel 2003 and 2007: This is another optional component for your BI solution. Many companies already own Office 2003, so use of Excel as a BI client is often attractive for its low cost and (relatively) low training curve.

Apart from Microsoft BI solution, there are number of other solution provider are there in market.

Following are the list of BI solution & tools provider

Cognos: http://www.cognos.com/products/cognos8businessintelligence/index.html

SAP: http://www.sap.com/solutions/netweaver/components/bi/index.epx

Business Object: http://www.uk.businessobjects.com/products/platform/enterprise.asp

Oracle: http://www.oracle.com/solutions/business_intelligence/index.html


SharePoint Portal Service/Server

Microsoft Windows SharePoint Services 3.0 is a versatile technology that organizations and business units of all sizes can use to increase the efficiency of business processes and improve team productivity. With tools for collaboration that help people stay connected across organizational and geographic boundaries, Windows SharePoint Services gives people access to information they need.

Built on Microsoft Windows Server 2003, Windows SharePoint Services also provides a foundation platform for building Web-based business applications that can flex and scale easily to meet the changing and growing needs of your business. Robust administrative controls for managing storage and Web infrastructure give IT departments a cost-effective way to implement and manage a high-performance collaboration environment. With a familiar, Web-based interface and close integration with everyday tools including the Microsoft Office system, Windows SharePoint Services is easy to use and can be deployed rapidly

Need of SharePoint?

• As companies grow so does the amount of their files. It soon becomes difficult to keep track of the multiplying documents and their locations. SharePoint overcomes this by allowing you to store and share your files in a central site.

• Sharing work files through email is a cumbersome process. SharePoint eliminates this by allowing files to be stored in one location, allowing easy access to all team members.

• Business Intelligence has traditionally remained in the hands of a few key decision makers within organizations. For years, it has been the goal of BI providers to “democratize business intelligence” by making it available to all levels of workers throughout companies. With the addition of PerformancePoint to the SharePoint Enterprise version of SharePoint, this vision is realized, finally taking business intelligence out of the hands of the few and into the hands of many.

• Today’s work occurs over multiple locations, whether it is in different countries, office locations, separate departments or at your home office. SharePoint enables teams and individuals to connect and collaborate together regardless of where they are located.

• Surveys have shown that employees can spend up to 20 – 30 % of their day searching for data and information. SharePoint eliminates this drag on productivity by providing the robust search functionality needed to find the information and expertise buried in the thousands, or hundreds of thousands of files a company generates in the course of business.

• It’s difficult and time consuming to create and maintain sites. SharePoint allows anyone to create sites for use within their company’s Intranet, as they are needed, whether they are departmental sites, document libraries, meetings sites, survey sites, or discussion boards.

Ref: http://office.microsoft.com/en-us/sharepointserver/FX100492001033.aspx


iPhone Application Development

iPhone is Revolutionary device which is designed and marketed by Apple Inc. iPhone provides downgraded version of OS framework to Mac OS X framework. iPhone has Cocoa Touch Framework.

Development tools involved in IPhone application development:

XCode: Complete development environment provides project management, a powerful source editor, and a graphical debugger

iPhone Simulator: Run, test, and debug your application locally on your Mac using a simulated iPhone

Instruments: Collect, display, and compare performance data graphically in real-time to optimize your application.

Interface Builder: Interface Builder makes designing a user interface as easy as drag and drop.

The more detail on the iPhone application development, check out the official “iPhone Developer Program” website.

http://developer.apple.com/iphone/program/

Development Related

ORM

Object-relational mapping is used to map object-oriented programming objects to relational databases managed by Oracle, DB2, Sybase, and other relational database managers (RDBMSs). This site provides facts about object-relational mapping products, architecture problem-solving, and direction in product comparison and selection.

Object-relational mapping products are designed to work well with object programming languages such as C#, C++, and Java. Database objects appear as programming language objects. Often, the interface for object-relational mapping products is the same as the interface for object-oriented databases.

ORM tools for .Net

ADO.NET Entity Framework is an object-relational mapping (ORM) framework for the .NET Framework. This framework is an ORM offering from Microsoft for the .NET Framework

ADO.NET Entity Framework is included with .NET Framework 3.5 Service Pack 1 and Visual Studio 2008 Service Pack 1, released on 11 Aug 2008. It also includes the capability of executing LINQ against ADO.NET Entity Framework entities.

ORM for PHP

There are several tools available right now for implementing ORM technique in PHP.

Following are the list of few ORM tools which can be used with PHP.

Check out following articles which demonstrate you in detail ORM implementation in PHP.

http://www.developertutorials.com/blog/php/getting-started-with-orm-in-php-331/
Microsoft .Net 3.5

There are several .NET language enhancements to be introduced with Visual Studio 2008 including implicitly typed variables, extension methods, anonymous types, object initializers, collection initializers and automatic properties. These language enhancements, along with features like generics, are critical to the use of some of the new features, such as LINQ with the ADO.NET Entity Framework.

These are the such enhancements in .net framework which really can bust development as well as productivity of developers.

Following are the few of articles which demonstrate the practical usage of new .net framework 3.5 enhancement.

http://www.simple-talk.com/dotnet/.net-framework/.net-3.5-language-enhancements/

MVC framework

MVC is a framework methodology that divides an application’s implementation into three component roles: models, views, and controllers.

  • “Models” in a MVC based application are the components of the application that are responsible for maintaining state. Often this state is persisted inside a database (for example: we might have a Product class that is used to represent order data from the Products table inside SQL).
  • “Views” in a MVC based application are the components responsible for displaying the application’s user interface. Typically this UI is created off of the model data (for example: we might create an Product “Edit” view that surfaces textboxes, dropdowns and checkboxes based on the current state of a Product object).
  • “Controllers” in a MVC based application are the components responsible for handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI. In a MVC application the view is only about displaying information – it is the controller that handles and responds to user input and interaction.

One of the benefits of using a MVC methodology is that it helps enforce a clean separation of concerns between the models, views and controllers within an application. Maintaining a clean separation of concerns makes the testing of applications much easier, since the contract between different application components are more clearly defined and articulated.

The MVC pattern can also help enable red/green test driven development (TDD) – where you implement automated unit tests, which define and verify the requirements of new code, first before you actually write the code itself.

MVC Framework for .NET

The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications

Check out following articles for the overview of ASP.NET MVC framework

http://www.asp.net/learn/mvc/tutorial-01-cs.aspx

MVC Framework for PHP

php.MVC implements the Model-View-Controller (MVC) design pattern, and encourages application design based on the Model 2 paradigm. This design model allows the Web page or other contents (View) to be mostly separated from the internal application code (Controller/Model), making it easier for designers and programmers to focus on their respective areas of expertise.

Reference: http://www.phpmvc.net/
IIS Search Engine Optimization Toolkit

The IIS Search Engine Optimization (SEO) Toolkit helps Web developers, hosting providers, and Web server administrators to improve their Web site’s relevance in search results by recommending how to make the site content more search engine-friendly. The IIS SEO Toolkit includes the Site Analysis module, the Robots Exclusion module, and the Sitemaps and Site Indexes module, which let you perform detailed analysis and offer recommendations and editing tools for managing your Robots and Sitemaps files.

The components of IIS Search Engine Optimization Toolkit include the following features:

  1. Site Analysis:

1.1. Fully featured site crawling engine – in order to perform detailed analysis of site’s structure and content, Site Analysis tool uses a built-in web crawler, called “iisbot”, to download and cache all the publicly available web site content. The web crawler is fully compliant with robots exclusion protocol.

1.2. Report summary dashboard – the results of site analysis are presented in an easy to use dashboard page that serves as a start page for various types of analysis. In addition this page includes a large set of pre-built queries for most common reports.

1.3. Query builder – Site Analysis tool includes a powerful and flexible query builder user interface that lets you create any custom queries that are run against the cached web site content.

1.4. Detailed URL information – you can obtain various detailed information about every URL in your web site, such as response headers and content, the pages that link to that URL as well as all the referenced URLs.

1.5. Detailed Violations descriptions – each content or SEO violation found on a web site has a detailed description as well as a recommended corrective action.

1.6. Word Analysis – any web page can be analyzed with regards to the most commonly used words and phrases within the content of that page. The results of that analysis can be used to select the keywords that most accurately describe the content of the page.

1.7. Route Analysis – unique routes to any page can be displayed in a separate report. This kind of information helps better understand how search engine and site visitors reach a particular page on your web site.

  1. Robots Exclusion

2.1. User interface for editing robots.txt file – the content of the robots exclusion file – robots.txt – can be edited by using IIS Manager GUI

2.2. Selecting URL paths from physical view of web site – the paths that are specified for “Allow” and “Disallow” directives in robots.txt file can be selected from the physical file system layout of your web site.

2.3. Selecting URL paths from virtual view of web site – the paths that are specified for “Allow” and “Disallow” directives in robots.txt file can be selected from the logical view of your web site obtained from the results of site analysis.

  1. Sitemaps and Sitemap Indexes

3.1. User interface for managing sitemap and sitemap indexes files – the content of the sitemap and indexes files can be edited by using IIS Manager GUI

3.2. Selecting URLs from physical view of web site – the URLs that are specified within a sitemap can be selected from the physical file system layout of your web site.

3.3. Selecting URLs from virtual view of web site – the URLs that are specified within a sitemap can be selected from the logical view of your web site obtained from the results of site analysis.

Rich Internet Application Tools

Adobe AIR

The Adobe® AIR™ runtime lets developers use proven web technologies to build rich Internet applications that run outside the browser on multiple operating systems.

Adobe AIR is divided into 3 different categories as per the expertise of particular developer.

AJAX: http://www.adobe.com/products/air/develop/ajax/

AIR with Flex : http://www.adobe.com/products/air/develop/flex/

AIR with flash: http://www.adobe.com/products/air/develop/flash/

Google Web toolkit

Google Web Toolkit 1.6 is a unique and remarkable platform-independent Java to JavaScript cross-compiler. The whole application may be written using most of the Java 1.5 features for which there is much tooling and test support. Not only that, but it is also possible to follow the Model View Controller (MVC) approach separating user interface from business logic, reducing cost of maintenance and increasing development flexibility. DOJO, on the other hand, requires you to develop the client using only the JavaScript language. This can be much more time consuming and more difficult to work with

http://code.google.com/webtoolkit/

jQuery

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

http://jquery.com/

Yahoo User Interface

The YUI Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX

http://developer.yahoo.com/yui/

Apart from these library/toolkits, there are several other toolkits which can also be utilized.

Mootools: http://mootools.net/

Dojo: www.dojotoolkit.org/

List of other toolkits: http://www.javascriptlibraries.com/

Tools for Web Development & Testing

Following are few exiting tools for the web development testing.

  1. XenoCode Browser SandboxBrowser testing is one of the most tedious and frustrating parts of web development. What designer or programmer hasn’t screamed bloody murder at broken alignments in Internet Explorer 6? One of the difficult parts of browser testing is that no developer can have every browser type on a single computer for proper testing.Enter XenoCode Browser Sandbox, a series of virtual applications that can run all popular browsers simultaneously. It does not even require the installation of software. However, XenoCode (Xenocode)’s Browser Sandbox can be heavy in some browsers and is still lacking in a Mac version.Use the following URL for further instruction on how to make use of such toolsRef: http://www.xenocode.com/browsers/
  2. W3C Validation ServicesW3C is THE standard in all of web validation. The W3C Validator looks into the markup of any website and display errors based on industry standards. It comes in over a dozen languages and a dozen varieties. Here are some of the most important validators:Following are the popular validation services provided by W3CW3C Markup Validation
    W3C CSS Validation
    W3C Link Checker
    W3C mobileOK Checker
  3. Javascript & CSS minifyHere is the site which allows you to minify javascript and perhaps the css alsohttp://www.vlead.in/resources/tools/minify-javascript/index.php

Following are the list of few articles which can also be referenced for different area of

Web development tools

There are many other tools available over the internet which can be utilized in daily web development.

Check out following link to improve your productivity

http://mashable.com/2008/11/01/web-development-tools/

Web 2.0 application & tools

http://www.go2web20.net



NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

Using Smarty with PHP: A PHP Template Engine

December 18th, 2009 Posted in My SQL, PHP, Web Developement Tags: , ,

Most of the time in site development, first the designer makes the interface and breaks into HTML for developer and then developer starts by creating simple scripts to add dynamic features to their Web sites. In real time practice some or more changes are required by client, which increases complexity because of PHP and HTML in same page. And another problem is that developer has to wait until designer completes design and HTML layout.

Why Use Templates?

Template process is quite valid and useful, and most developers who uses this method, agree that the separation of business logic and layout logic makes the code a lot easier to understand and maintain. This is the reason behind templates, to separate business logic from layout.

Advantages of smarty

Smarty is a new development concept in the PHP, and it brings also several new and unique features. One of the mail advantages is that Smarty ‘compiles’ the parsed templates into PHP scripts, and then reuses the compiled template when required. This brings a huge performance improvement over other template solutions, as the main PHP script doesn’t need to parse and output the same template on every request.

Smarty also allows developers to create their own set of functions and have Smarty recognize them. And it also has built-in caching support and special constructs that can be used on templates to control the format of the layout.

And very importantly, Smarty provides developers’ tools that help them separate the business-logic code from the layout-formatting code. And Smarty goes one step further by allowing developers to put control-flow structures in the template source. This might sound a bad idea, since it would imply business-like logic in the template, but it is actually quite useful. You can tell Smarty to use a specific style for any html control on the template itself, instead of having PHP code do this work. After all, this is template-related information.

Installing Smarty

Smarty is quite simple to install. You can get various versions available for download Smarty.

After downloading and extracting the files, copy the resulting Smarty directory to some place inside your include path. A good option is to copy this directory in the PEAR library directory. In UNIX environments, it will usually be:

$ cp -R Smarty /usr/local/lib/php/

In Windows computers, you will need to copy the Smarty directory to ‘C:\php\pear’.

Give write rights to Apache user for template directory and sub directories. This is the directory that smarty uses to store compiled templates.

Using Smarty

Now you have write simple PHP script to manipulate and assign template variable to a value. Like..

<?php

 require 'Smarty.class.php';
 $smarty = new Smarty; 
$smarty->assign("variable_name","Variable Value");
$smarty->display('display.tpl');
?>

Above script includes the Smarty class, which is included in Smarty.class.php. After that object is created for smarty class and the template variable named $ variable_name  will hold the value " Variable Value".
At the time of creating templates, the placeholders will be placed as {$variable_name}, but the placeholder delimiter can also be changed. {$variable_name} will be replaced by its value and output to the browser. Smarty also compiles the template into a PHP script, so the next time this script is requested, the template will not be parsed again and the compiled PHP script will be used instead.

Summery

Also Control Flow statements, conditions can be used in smarty. Smarty works for designers and developers both and also can reduce development and maintenance time. One has to just go through syntax used for smarty and it will make your work easier.



NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.

10 PHP Open source Ecommerce Framework

December 16th, 2009 Posted in My SQL, PHP, Web Developement Tags: , , ,

Electronic commerce, commonly known as e-commerce or eCommerce, consists of the buying and selling of products or services over electronic systems such as the Internet and other computer networks. The amount of trade conducted electronically has grown extraordinarily since the spread of the Internet. A wide variety of commerce is conducted in this way, spurring and drawing on innovations in electronic funds transfer, supply chain management, Internet marketing, online transaction processing, electronic data interchange (EDI), inventory management systems, and automated data collection systems. Modern electronic commerce typically uses the World Wide Web at least at some point in the transaction’s lifecycle, although it can encompass a wider range of technologies such as e-mail as well.

Experience the most comprehensive software as a service (SaaS) ecommerce solution available today. Target explosive growth with a solution that combines over 250+ award-winning ecommerce software features with a highly customizable web storefront, enterprise-class site hosting (99.9% uptime), and a robust shopping experience for customers. Give your customers the best shopping experience with the latest social media and web 2.0.

Online shopping, an important component of electronic commerce was invented by Michael Aldrich in the UK in 1979. The world’s first recorded B2B was Thomson Holidays in 1981

ü The first recorded B2C was Gateshead SIS/Tesco in 1984

ü The world’s first recorded online shopper was Mrs. Jane Snowball of Gateshead, England

ü During the 1980s, online shopping was also used extensively in the UK by auto manufacturers such as Ford, Peugeot-Talbot, General Motors and Nissan.

ü All these organizations and others used the Aldrich systems. The systems used the switched public telephone network in dial-up and leased line modes. There was no broadband capability.

There are 10 PHP Open source Ecommerce Framework.

image002Zen Cart

Zen Cart truly is the art of e-commerce; a free, user-friendly, open source shopping cart system. The software is being developed by group of like-minded shop owners, programmers, designers, and consultants that think e-commerce could be and should be done differently. Some solutions seem to be complicated programming exercises instead of responding to users’ needs, Zen Cart puts the merchant’s and shopper’s requirements first. Similarly, other programs are nearly impossible to install and use without an IT degree, Zen Cart can be installed and set-up by anyone with the most basic computer skills. Others are so expensive … not Zen Cart it’s FREE!

Zen Cart will deliver the ultimate online shopping experience to your customers. Navigating through your merchandise offerings is a breeze with Zen Cart, the program provides several “Spotlight” lists in addition to the traditional category to product links. Once a product is added to the shopping cart, secure checkout is a simple 3-step process. After providing the billing information, your customer chooses the shipping method. (Multiple shipping methods including real-time internet shipping quotes are built-in) Next, a payment type is chosen from one of the popular payment modules. (Pay Pal and AuthorizeNet are just 2 of the included modules) Last, the customer reviews the order, shipping and payment choices, and confirms the order. You are immediately notified of the order and your customer automatically receives an e-mail confirmation.

Zen Cart gives web designers a robust and customizable electronic storefront that’s easy to keep up-to-date with new features. It provides usable, intuitive and unobtrusive purchase flows right out of the box based on proven industry best-practices – there are no major revisions required to get things right for your clients!

One of the secrets behind its power lies in our robust template system that “abstracts” the look-and-feel from the code and logic behind Zen Cart. This enables you to give clients a truly custom solution that integrates quickly and perfectly with their existing marketing websites.

image004OsCommerce

OsCommerce is the leading Open Source online shop e-commerce solution that is available for free under the GNU General Public License. It features a rich set of out-of-the-box online shopping cart functionality that allows store owners to setup, run, and maintain their online stores with minimum effort and with no costs, license fees, or limitations-involved.

The goal of the osCommerce project is to continually evolve by attracting a community that supports the ongoing development of the project at its core level and extensively through contributions to provide additional functionality to the already existing rich feature-set.

Everything you need to get started in selling physical and digital goods over the internet, from the Catalog front-end that is presented to your customers, to the Administration Tool back end that completely handles your products, customers, orders, and online store data.

image005CartStore Shopping Cart Software

CartStore is a sophisticated ecommerce platform that was built for actual real ecommerce websites. It has been in development since March of 2000. It was forked from the osCommerce project in 2006 where extensive development and modernization occurred.

image007Eclime – E-Commerce Jet Engine

CartStore is a sophisticated ecommerce platform that was built for actual real ecommerce websites. It has been in development since March of 2000. It was forked from the osCommerce project in 2006 where extensive development and modernization occurred.

image009Freeway
Freeway is the most advanced Open Source eCommerce platform and includes an array of features not found in extremely expensive commercial systems. Without having to purchase a commercial system and then paying a developer to build custom installation, Freeway does most of what you need out of the box. For example, instead of getting dragged into purchasing an overpriced products based system and having a developer struggle for weeks and eventually fail to force products sales into event sales, Freeway already support events AND services AND subscriptions.

image011Magento

Magento is a new professional open-source eCommerce solution offering unprecedented flexibility and control. Magento was designed with the notion that each eCommerce implementation has to be unique since no two businesses are alike. Magento’s modular architecture puts the control back in the hands of the online merchant and places no constraints on business processes and flow

.

image013OpenCart

OpenCart is an open source PHP-based online shopping cart system. A robust

E-commerce solution for Internet merchants with the ability to create their own online business and participate in e-commerce at a minimal cost.

image015OsCSS

OsCSS web standard compliant open source online shop. The design structure is based on a template system, easily customizable and build on CSS / XHTML

image017PrestaShop

Despite its technical sophistication and advanced functionality, the PrestaShop e-Commerce Solution is very light (around 2 MB not including translation files), so it’s easy to download, install, and update.

PrestaShop is so lightweight and speedy, even customers with slow connection speeds will enjoy buying from you!

image019OXID eShop

OXID eShop Community Edition is proven and flexible open source software. With its modular, state-of-the-art and standards-based architecture, customization is easy.

The above article is respected to share knowledge not commercial use.



NOTE :

If you are in need of any Web Development feel free to Inquire us . Dhanashree Inc. Expertise in Asp.net Development, Php Development, Website designing, Open Source customisation. Dhanashree Inc can be our offshore development company / outsourcing web development company, hire dedicated web programmers.

Above information is for knowledge sharing if you have problem / issue / suggestion please intimate us with details for proper and prompt action.