Top 10 Firefox plugins for web developers & designers

Firefox is my favorite browser for creating and testing website design and functionality.The reasons for the success of Firefox are speed, stability and a strong open source community behind it. Although there exist hundreds of absolutely great plugins I’d like to share with you today only these plugins that helped me best while working on web projects in the past:

1. Web Developer

web-developerA must-have plugin for any web developer. It will add a new toolbar to Firefox with a lot of great tools for displaying page information, request headers, CSS element information, disabling/enabling Javascript, Cookies, Images and CSS, validation and displaying Javascript generated content. I just named some of the features but there is a lot more inside this tool. So make sure to have it.

2. SearchStatus

seachstatusThis one is great helper for SEO work. It includes a better PageRank information (forget the original - problems with cached values), Alexa Rank and the essential NoFollow link highlighter.

3. HTML Validator

html-validatorI would say 20% of SEO work is On-Site optimization. This tool will help you in locating every validation problem of your HTML code. And I guess most of you will agree: Google loves valid content.

4. Javascript Debugger

javascript-debuggerWorking with Javascript can get very tricky, especially when you are loading dynamic content via Ajax requests. Just looking into the code won’t help you a lot. The Javascript Debugger allows you to set breakpoints in your script and inspect variables and objects.

5. Live Http Headers

live-http-headersAs the name already says this plugin will show you all Http headers while browsing a website. Sometimes a valuable source to understand the redirection mechanism of a website and how data is sent across.

6. Leet Key

leet-keyA very useful tool for quick transforming encoded data. Sometimes when I need to check if a Base64 encoded parameter was transferred correctly I can decode it with this plugin to plain text. Apart of the transforming for Base64, Bin, Hex, Morse and others, there is even a functionality for encrypted contents in AES and DES.

7. JS View

js-viewWhen you want to have a quick look on a JS or CSS file from some other website you need to view the page source and copy the file path. But it can be so much simpler. JS View provides you any given JS/CSS file of a website with the easiness of a mouse click.

8. Duplicate Tab

duplicate-tabSometimes you need the currently open page in a second tab. But if it’s javascript generated content you cannot just copy and paste the URL in another tab. But Duplicate Tab can.

9. Add N Edit Cookies

add-n-edit-cookiesThis tool allows you to manipulate and add cookies and can help you to test the security of your website.

10. Clear Cache

clear-cacheVery simple and useful. While you are changing elements on your website you want to make sure to see the changes and not a cached version. Things like that can end up in frustration.

Resources: christian-kalmar

The industry's 10 best IT certifications

IT certifications boast numerous benefits. They bolster resumes, encourage higher salaries, and assist in job retention. But which IT certifications are best?

#1: MCITP

The new-generation Microsoft Certified IT Professional credential, or MCITP for short, is likely to become the next big Microsoft certification. Available for a variety of fields of expertise ? including database developer, database administrator, enterprise messaging administrator, and server administrator ? an MCITP validates a professional’s proven job-role capabilities. Candidates must pass several Microsoft exams that track directly to their job role before earning the new designation.

As with Microsoft’s other new-generation accreditations, the MCITP certification will retire when Microsoft suspends mainstream support for the platforms targeted within the MCITP exams. By matching the new certification to popular job roles, as has been done to some extent with CompTIA’s Server+ (server administrator), Project+ (project manager), and A+ (desktop support) certifications, Microsoft has created a new certification that’s certain to prove timely, relevant, and valuable.

#2: MCTS

The new-generation Microsoft Certified Technology Specialist (MCTS) helps IT staff validate skills in installing, maintaining, and troubleshooting a specific Microsoft technology. The MCTS certifications are designed to communicate the skills and expertise a holder possesses on a specific platform.

For example, candidates won’t earn an MCTS on SQL Server 2008. Instead, they’ll earn an MCTS covering SQL Server business intelligence (MCTS: SQL Server 2008 Business Intelligence), database creation (MCTS: SQL Server 2008, Database Development), or SQL server administration (MCTS: SQL Server 2008, Implementation and Maintenance).

These new certifications require passing multiple, tightly targeted exams that focus on specific responsibilities on specific platforms. MCTS designations will expire when Microsoft suspends mainstream support for the corresponding platform. These changes, as with other new-generation Microsoft certifications, add value to the accreditation.

#3: Security+

Security continues to be a critical topic. That’s not going to change. In fact, its importance is only going to grow. One of the quickest ways to lose shareholder value, client confidence, and sales is to suffer a data breach. And no self-respecting technology professional wants to be responsible for such a breach.

CompTIA’s Security+ accreditation provides a respected, vendor-neutral foundation for industry staff (with at least two years of experience) seeking to demonstrate proficiency with security fundamentals. While the Security+ accreditation consists of just a single exam, it could be argued that any IT employee charged with managing client data or other sensitive information should, at a minimum, possess this accreditation. The importance of ensuring staff are properly educated as to systems security, network infrastructure, access control, auditing, and organizational security principles is simply too important to take for granted.

#4: MCPD

There’s more to information technology than just administration, support, and networking. Someone must create and maintain the applications and programs that power organizations. That’s where the new-generation Microsoft Certified Professional Developer (MCPD) credential comes into play.

The MCPD accreditation measures a developer’s ability to build and maintain software solutions using Visual Studio 2008 and Microsoft .NET Framework 3.5. Split into three certification paths (Windows Developer 3.5, ASP.NET Developer 3.5, and Enterprise Applications Developer 3.5), the credential targets IT professionals tasked with designing, optimizing, and operating those Microsoft technologies to fulfill business needs.

A redesigned certification aimed at better-measuring real-world skills and expertise, the MCPD will prove important for developers and programmers. Besides requiring candidates to pass several exams, the MCPD certification will retire when Microsoft suspends mainstream support for the corresponding platform. The change is designed to ensure the MCPD certification remains relevant, which is certain to further increase its value.

#5: CCNA

The Cisco Certified Internetwork Expert (CCIE) accreditation captures most of the networking company’s certification glory. But the Cisco Certified Network Associate (CCNA) might prove more realistic within many organizations.

In a world in which Microsoft and Linux administrators are also often expected to be networking experts, many companies don’t have the budgets necessary to train (or employ) a CCIE. But even small and midsize corporations can benefit from having their technology professionals earn basic proficiency administering Cisco equipment, as demonstrated by earning a CCNA accreditation.

As smaller companies become increasingly dependent upon remote access technologies, basic Cisco systems skills are bound to become more important. Although many smaller organizations will never have the complexity or workload necessary to keep a CCIE busy, Cisco’s CCNA is a strong accreditation for technology professionals with a few years’ experience seeking to grow and improve their networking skills.

#6: A+

Technology professionals with solid hardware and support skills are becoming tougher to find. There’s not much glory in digging elbow-deep into a desktop box or troubleshooting Windows boot errors. But those skills are essential to keeping companies running.

Adding CompTIA’s A+ certification to a resume tells hiring managers and department heads that you have proven support expertise. Whether an organization requires desktop installation, problem diagnosis, preventive maintenance, or computer or network error troubleshooting, many organizations have found A+-certified technicians to be more productive than their noncertified counterparts.

Changes to the A+ certification, which requires passing multiple exams, are aimed at keeping the popular credential relevant. Basic prerequisite requirements are now followed by testing that covers specific fields of expertise (such as IT, remote support, or depot technician). The accreditation is aimed at those working in desktop support, on help desks, and in the field, and while many of these staffers are new to the industry, the importance of an A+ certification should not be overlooked.

#7: PMP

Some accreditations gain value by targeting specific skills and expertise. The Project Management Professional (PMP) certification is a great example.

The Project Management Institute (PMI), a nonprofit organization that serves as a leading membership association for project management practitioners, maintains the PMP exam. The certification measures a candidate’s project management expertise by validating skills and knowledge required to plan, execute, budget, and lead a technology project. Eligible candidates must have five years of project management experience or three years of project management experience and 35 hours of related education.

As organizations battle tough economic conditions, having proven project scheduling, budgeting, and management skills will only grow in importance. The PMI’s PMP credential is a perfect conduit for demonstrating that expertise on a resume.

#8: MCSE/MCSA

Even years after their introduction, Microsoft Certified Systems Engineer (MCSE) and Microsoft Certified Systems Administrator (MCSA) credentials remain valuable. But it’s important to avoid interpreting these accreditations as meaning the holders are all-knowing gurus, as that’s usually untrue.

In my mind, the MCSE and MCSA hold value because they demonstrate the holder’s capacity to complete a long and comprehensive education, training, and certification program requiring intensive study. Further, these certifications validate a wide range of relevant expertise (from client and server administration to security issues) on specific, widely used platforms.

Also important is the fact that these certifications tend to indicate holders have been working within the technology field for a long time. There’s no substitute for actual hands-on experience. Many MCSEs and MCSAs hold their certifications on Windows 2000 or Windows Server 2003 platforms, meaning they’ve been working within the industry for many years. While these certifications will be replaced by Microsoft’s new-generation credentials, they remain an important measure of foundational skills on Windows platforms.

#9: CISSP

As mentioned with the Security+ accreditation earlier, security is only going to grow in importance. Whatever an organization’s mission, product, or service, security is paramount.

(ISC)2, which administers the Certified Information Systems Security Professional (CISSP) accreditation, has done well building a respected, vendor-neutral security certification. Designed for industry pros with at least five years of full-time experience, and accredited by the American National Standards Institute (ANSI), the CISSP is internationally recognized for validating a candidate’s expertise with operations and network and physical security, as well as their ability to manage risk and understand legal compliance responsibilities and other security-related elements.

#10: Linux+

Linux continues to make inroads, though. The open source alternative is an important platform. Those professionals who have Linux expertise and want to formalize that skill set will do well adding CompTIA’s Linux+ certification to their resumes.

The vendor-neutral exam, which validates basic Linux client and server skills, is designed for professionals with at least six to 12 months of hands-on Linux experience. In addition to being vendor-neutral, the exam is also distribution neutral (meaning the skills it covers work well whether a candidate is administering Red Hat, SUSE, or Ubuntu systems).

Resources: TechRepublic

10 C# Shorthands that improve productivity

1. The ? conditional evaluation operator

I first read about the ? operator in the “The C Programming Language” book by Brian Kernighan and Dennis Ritchie (first published in 1978, but I didn’t get around to reading it until well into the second edition). So this isn’t anything new. But it IS handy. It allows you to compress a common if-then-else pattern into a single assignment.

int x = 10;
int y = 20;
int max;

if (x > y)
max = x;
else
max = y;

Using the (Question) ? Positive Answer : Negative Answer patterns the above can be rewritten as:

int x = 10;
int y = 20;
int max = (x > y) ? x : y;

2. Null-Coalesce operator (??)

How often do you test for null values in your code? Often? Then the null-coalesce operator (??) comes in handy. To see how it works consider the following code example:

object cache = null;
object d = new object();
object e;

if (c != null)
e = c;
else

It is obvious that we can rewrite this using the single ? operator :

object cache = null;
object d = new object();

Using the ?? operator we can make it even shorter. If the left hand side is null, the right hand side is assigned.

object cache = null;
object d = new object();

3. Object Initializers

After you create a new object you often have to assign one or more of its properties. With the introduction of C# 3.0 it is now possible to use object initializers to both improve the readability of this, and to shorten your code.

Customer c = new Customer();
c.Name = "James";

can be written as:

c.Address = "204 Lime Street";

4. The using statement

Often you will need to allocate a system resource such as a font, file handle, network resource etc. Each time you need such a resource there are three critical steps to go through: You acquire the resource, you use it, and then you dispose of it. If you forget to properly dispose of it you will have created a memory or resource leak. This is best illustrated through the following patterns:

// 1. Allocation of the object
Font font1 = new Font("Arial", 10.0f);
try
{
// 2. The bit where we use the resource
}
finally
{
// 3. Disposal of the object
if (font1 != null)
((IDisposable)font1).Dispose();
}

The using statement allows us to compress this down to:

// Allocate the resource
using (Font font1 = new Font("Arial", 10.0f))
{
// The bit where we use the resource
}
// Disposal is automatic

The using statement is intended to be used with objects that implement the “IDisposable” interface which in practice is all .NET objects that allocate and manage resources.

5. Aliases for long winded namespaces and types

The names of C# identifiers can become quite long. If you are doing Microsoft Office automation in C# you might want to do something simple like open MS Word and change a document. You can use the “using” statement to create an alias for either a class or a namespace.

using Word = Microsoft.Office.Interop.Word;
...
Word.Application = new Word.Application() { Visible = True; }

6. Nullable objects

A variable needs to have a value, it cannot be null. Sometimes it would be handy it was possible to assign “null” (eg. undefined) to a variable. .NET 2.0 introduced the Nullable generic that makes this possible. The following two lines produce exactly the same object:

Nullable x = null;
int? x = null;

By putting a ? following a variable definition the compiler will wrap a Nullable generic around the type.

7. Automatic Properties

C# 3.0 introduced automatic properties. A property typically consists of (but doesn’t have to) a private variable which is exposed to the outside world through getters and setters. The following is common example of this:

public class Person
{
private string _firstName;
public string FirstName
{
get { return _firstName; }
set { _firstName = value; }
}
}

From C# 3.0 on we can reduce the above to:

public class Person
{
public string Firstname { get; set; }
}

The C# compiler will automatically generate a backing variable and the correct get and set properties. Why is this useful? After all you could have just made a string variable in the class public instead.

By defining it as a property allows you to add the actual validation logic to your class at a later stage. The in-memory signature of the class won’t change which means that any external libraries compiled against your code will not have to be recompiled.

8. Type inference

In typical C# you will always carefully spell out your definitions:

string MyString = “Hello World”;

From the right side of the declaration it is obvious that only one type (string) will ever match this definition. So instead of us doing the work, why not let the compiler figure this out?

var MyString = “Hello World”;

The above definition will also create a string variable named “MyString”. It is important to note that C# is still strongly typed.There is no performance impact results from using type inference.

The compiler does all the work figuring out the data type at compile time. Of course this feature created two opposite camps, one that thinks var should be liberally applied, and another one that abhors the whole idea. The middle ground seems to be that var should be used there were its use is obvious.

var SeniorStaff = Employees.Where(s => s.Age > 35);
foreach(var Member in SeniorStaff)
Console.WriteLine("Name: {0} Age: {1}",Member.Name,Member.Age);

9. Lambda Expressions

C# 2.0 introduced anonymous methods, which are methods defined inside a method. Incredibly powerful and a nice way to put all kinds of evaluation logic inside your code they had the drawback that they could be quite hard to read.

Func mySeniorStaffFilter = delegate(int a) { return a > 35; };

The above method takes an integer as a parameter, and returns a boolean. It checks if the staff member passed to it is older than 35. If so, it returns true.

Lamba expressions make things a little easier to read, while being functionally exactly the same:

Func mySeniorStaffFilter = a => a > 35;

Even better, you can define them anywhere a delegate would have fitted:

var SeniorStaff = Employees.Where(s => s.Age > 35);

10. string.IsNullOrEmpty

Not really a language feature, but a useful little library function in its own right. How often do you need to test if a string is empty? Or null? The string.IsNullOrEmpty method returns true if this is the case.

if (String.IsNullOrEmpty(s) == true)
return "is null or empty";
else
return String.Format("(\"{0}\") is not null or empty", s);

Agile Bug Management Anti-Patterns

Agile development books often skip bug management practice. However, there are several dangerous misunderstandings (anti-patterns) that are quite common. It is better to recognize the problem early and fight to win. Here are three common bug management anti-patterns in a development process.

Bug fixing phase inside iteration

Symptom: You have several days at the end of iteration fully dedicated to bug fixing.

If you have a bug fixing phase inside an iteration, you have mini-waterfall in each iteration, which is not a very good idea (in agile we blame waterfall for good reason, don’t we?). Story should be tested as soon as it is completed.

Bug fixing iteration

Symptom: You run several iterations with almost no or little bug fixing and then one (or even two!) iterations fully dedicated to bug fixing.

Bug fixing iterations kill your iterative development. It is even worse than mini-waterfall. Such iterations increase your work in progress dramatically. You have nothing done during several iterations before bug fixing iteration. You have nothing to ship. Moreover, bug fixing iterations reduce motivation, people don't like to fix bugs for 2 weeks or for the whole month.

No “Zero open bugs” rule in user story’s Definition of Done

Symptom: You have open bugs in a completed iteration.

You may have decided that some bugs discovered during story development are unimportant and can be postponed to future releases/iterations. This is a very dangerous practice that leads to bugs accumulation. Moreover, it may be a reason for Bug fixing iteration (see above). The best strategy is to have “Zero open bugs” rule in Definition of Done for user story.

Resources: targetprocess

Three Layer Architecture in C#.NET

First let me give you small overview about topic I would like to cover in this artical.

1. Tier vs. Layer

2. Three Tier/Layer Architecture Design Components

3. Demo: Three Layer Windows Application in C#.NET

1. Tier vs. Layer

1.1 Tier: Tier indicates a physical separation of components, which may mean different assemblies such as DLL, EXE etc on the same server or multiple servers.

As you can see in the above figure Data Tier have no direction with Presentation Tier, but there is intermediate Tire called Business Tier which is mainly responsible to pass the data from Data Tier to Presentation Tier and to add defined business logic to Data.

So, If we seperete each Tier by their funcationality then we come to know on below conclusion

1.2 Layer: Layer indicates logical separation of components, such as having distinct namespaces and classes for the Database Access Layer, Business Logic Layer and User Interface Layer.


2. Three Tier/Layer Architecture Design Components

As we already seen tier is sum of all the physical components, we can separate the three tiers as Data Tier, Business Tier and Presentation Tier.

- Data Tier is basically the server which stores all the application’s data. Data tier contents Database Tables, XML Files and Other means of storing Application Data.

- Business Tier is the mainly working as bridge between Data Tier and Presentation Tier. All the Data is parsing through Business Tier before parsing to presentation Tier. Business Tier is sum of Business Logic Layer, Data Access Layer and Value Object and other components used to add business logic.

- Presentation Tier is the tier in which user’s interact with an application. Presentation Tier contents Shared UI code, Code Behind and Designers used to represent information to user.

Above figure is a mixture of Three Tier and Three Layer Architecture. Here, we can clearly see a differen between Tier and Layer. Since each components are independent of each other, they are easily maintable without changing to whole code.

This approach is really very important when several developer are work on same project and some module need to re-use in other project. In a way we can distribue a work among developer and also maintain it in future without much problem in future.

Testing is also a very important issue for Arhitecture when we are considering writing a testcase for the project. Since it’s like a modular architecture it’s very handy testing each module and to trace out bug without going to whole code.

3. Demo: 3 Layer Windows Application in C#.NET

Let’s go thought from each module to other to have better understanding of it.

dbConnection:

This class is mainly use to do the database activity like Select, Update and Delete query to database. It also checks if the database connection is open or not. If database connection is not open then it opens the connection and performs the database query. The database results are to be receive and being pass in Data Table in this class.

This class takes the database setting from the app.config file so it’s really flexible to manage the database settings.

Collapse
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace ThreeLayerDemo.Core
{
public class dbConnection
{
private SqlCommand myCommand;
private SqlDataAdapter myAdapter;
private SqlConnection conn;

/// <constructor>
/// Initialise Connection
/// </constructor>
public dbConnection()
{
myCommand = new SqlCommand();
myAdapter = new SqlDataAdapter();
conn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbConnectionString"].ConnectionString);

try
{
myCommand.Connection = openConnection();
}
catch
{
Console.Write("Error - constructor.dbConnection");
}
}

/// <method>
/// Open Database Connection if Closed or Broken
/// </method>
private SqlConnection openConnection()
{
if (conn.State == ConnectionState.Closed || conn.State == ConnectionState.Broken)
{
conn.Open();
}
return conn;
}

/// <method>
/// Select Query
/// </method>
public DataTable executeSelectQuery(String _query)
{
DataTable dataTable = new DataTable();
dataTable = null;
DataSet ds = new DataSet();
try
{
myCommand.Connection = openConnection();
myCommand.CommandText = _query;
myCommand.ExecuteNonQuery();
myAdapter.SelectCommand = myCommand;
myAdapter.Fill(ds);
dataTable = ds.Tables[0];
}
catch (SqlException e)
{
Console.Write("Error - Connection.executeSelectQuery - Query: " + _query + " \nException: " + e.StackTrace.ToString());
return null;
}
finally
{

}
return dataTable;
}

/// <method>
/// Insert Query
/// </method>
public bool executeInsertQuery(String _query)
{
try
{
myCommand.Connection = openConnection();
myCommand.CommandText = _query;
myAdapter.InsertCommand = myCommand;
myCommand.ExecuteNonQuery();
}
catch (SqlException e)
{
Console.Write("Error - Connection.executeInsertQuery - Query: " + _query + " \nException: \n" + e.StackTrace.ToString());
return false;
}
finally
{
}
return true;
}

/// <method>
/// Update Query
/// </method>
public bool executeUpdateQuery(String _query)
{
try
{
myCommand.Connection = openConnection();
myCommand.CommandText = _query;
myAdapter.UpdateCommand = myCommand;
myCommand.ExecuteNonQuery();
}
catch (SqlException e)
{
Console.Write("Error - Connection.executeUpdateQuery - Query: " + _query + " \nException: " + e.StackTrace.ToString());
return false;
}
finally
{
}
return true;
}
}
}

Database Access Layer:

Database Access Layer (DAO) builds the query based on received parameters from the Business Logic Layer and passes it the dbConnection class for execution. And simple return results from the dbConnection class to Business Logic Layer.

---

Collapse
    using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ThreeLayerDemo.Core
{
public class UserDAO
{
private dbConnection conn;

/// <constructor>
/// Constructor UserDAO
/// </constructor>
public UserDAO()
{
conn = new dbConnection();
}

/// <method>
/// Get User Email By Firstname or Lastname and return DalaTable
/// </method>
public DataTable searchByName(string _username)
{
string query = "select * from [t01_user] where t01_firstname like '" + _username + "' or t01_lastname like '" + _username + "' ";
return conn.executeSelectQuery(query);
}

/// <method>
/// Get User Email By Id and return DalaTable
/// </method>
public DataTable searchById(string _id)
{
string query = "select * from [t01_user] where t01_id = '" + _id + "' ";
return conn.executeSelectQuery(query);
}
}
}

Value Object:

Value Object is nothing more but class which contents GET and SET methods. It’s mainly use to pass Data from one class to other. It’s directly connected with Business Logic Layer and Presentation Layer. As you can see in the diagram object value are being SET in Business Logic Layer and GET from Presentation Layer.
---

Collapse
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ThreeLayerDemo.Core
{
public class UserVO
{
private int _idUser;
private string _firstname;
private string _lastname;
private string _email;

/// <constructor>
/// Constructor UserVO
/// </constructor>
public UserVO()
{
//
// TODO: Add constructor logic here
//
}

public int idUser
{
get
{
return _idUser;
}

set
{
_idUser = value;
}
}

public string firstname
{
get
{
return _firstname;
}

set
{
_firstname = value;
}
}

public string lastname
{
get
{
return _lastname;
}
set
{
_lastname = value;
}
}

public string email
{
get
{
return _email;
}

set
{
_email = value;
}
}
}
}


Business Logic Layer:

Business Logic Layer (BUS) works as a bridge between Presentation Layer and DAO. All the user value received from the presentation layer and being passed to BUS. The results received from the DAO are in row data in Data Table format but in BUS it’s converting into Value Objects (VO). Business Logic Layer (BUS) is most important class in the whole architecture because it mainly contents all the business logic of the program. Whenever user wants to update the business logic of the program only need to update this class.

---
Collapse
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ThreeLayerDemo.Core
{
/// <summary>
/// Summary description for UserBUS
/// </summary>
public class UserBUS
{
private UserDAO _userDAO;

/// <constructor>
/// Constructor UserBUS
/// </constructor>
public UserBUS()
{
_userDAO = new UserDAO();
}

/// <method>
/// Get User Email By Firstname or Lastname and return VO
/// </method>
public UserVO getUserEmailByName(string name)
{
UserVO userVO = new UserVO();
DataTable dataTable = new DataTable();

dataTable = _userDAO.searchByName(name);

foreach (DataRow dr in dataTable.Rows)
{
userVO.idUser = Int32.Parse(dr["t01_id"].ToString());
userVO.firstname = dr["t01_firstname"].ToString();
userVO.lastname = dr["t01_lastname"].ToString();
userVO.email = dr["t01_email"].ToString();
}
return userVO;
}

/// <method>
/// Get User Email By Id and return DalaTable
/// </method>
public UserVO getUserById(string _id)
{
UserVO userVO = new UserVO();
DataTable dataTable = new DataTable();
dataTable = _userDAO.searchById(_id);

foreach (DataRow dr in dataTable.Rows)
{
userVO.idUser = Int32.Parse(dr["t01_id"].ToString());
userVO.firstname = dr["t01_firstname"].ToString();
userVO.lastname = dr["t01_lastname"].ToString();
userVO.email = dr["t01_email"].ToString();
}
return userVO;
}
}
}

Presentation Layer:

Presentation Layer is the only layer which is directly connected with the user. So in this matter it’s also really important layer for the marketing purpose. Presentation Layer is mainly used for getting user data and then passing it to Business Logic Layer for further procedure, and when data received in Value Object then it’s responsible to represent value object in the appropriate form which user can understand.
---

Collapse
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ThreeLayerDemo.Core;

namespace ThreeLayerDemo
{
public partial class frmLogin : Form
{
private UserBUS _userBUS;

public frmLogin()
{
InitializeComponent();
_userBUS = new UserBUS();
}

private void btnSearch_Click(object sender, EventArgs e)
{
UserVO _userVO = new UserVO();
_userVO = _userBUS.getUserEmailByName(txtUsername.Text);
MessageBox.Show(_userVO.email ,"Result",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}

private void btnCancel_Click(object sender, EventArgs e)
{
Close();
}
}
}

Resources: CodeProject

Performance testing of Dictionary - List - Hashtable

Still working with high-volume realtime datafeeds, I'm struggling to understand where the bottleneck in my code is. It's not with the database, it's not with the network - it's somewhere in the code. Now that doesn't help a lot.

So I decided to have a look at the different data structures that could be usable for my needs. Right now I'm using a List to keep track of my orders, and each time I get a new order, I check that list for the given ID.

So I'm starting to wonder, maybe there is a performance issue with the List data structure. So I made a small test with the following code:

static void TestList()

{

var watch = new Stopwatch();

var theList = new List<int>();

watch.Start();

//Fill it

for (int i = 0; i <>

{

theList.Add(i);

}

watch.Stop();

Console.WriteLine("Avg add time for List: {0}", (watch.Elapsed.TotalMilliseconds / noOfIterations));

watch.Reset();

watch.Start();

//Test containsKey

for (int j = 0; j <>

{

theList.Contains(j);

}

watch.Stop();

Console.WriteLine("Avg Contains lookup time for List: {0}", (watch.Elapsed.TotalMilliseconds / noOfIterations));

}

I created similar test code for Dictionary and HashSet. In all of the tests I used a loop where the given key always existed in the data structure. I used Add instead of Insert, because of tests I've seen online show that this is much faster. For example, this one.

First run, I used 1,000 for the noOfIterations variable and ran it three times.

The horizontal scale here is in milliseconds, so things are reasonably fast. A value of 0.2 gives you a possible 200 adds per second. As you probably can see without checking the numbers, dictionary is faster. List is slower for lookup, but HashSet suprises a little with the slow add function. So what happens when we go to 100,000 items?

OK, List is a lot slower for lookup still. Add seems to compare ok though. Let's see how it compares if we remove the lookup-time from the chart:


Now that's a result! Turns out List is your winner if fast adding is all you care about. If you want to look up your values later though, dictionary is your winner. Hope this will save some time for other developers in the same situation. Also feel free to comment if you find different results, or a problem with my test!

Resources: softscenario.blogspot.com

Comparing CI build tools: Cruise Control and Hudson


images Hudson


banner Cruise Control

1 Open Source 1 Open Source
2 Easy installation: Just java -jar Hudson.war, or deploy it in a servlet container. No additional install, no database.

2.

It also gives us very easy installation. Just unzip the downloaded zip file. That’s it. It is actually using an internal Jetty server. No Database, no install here also.
3 Easy configuration: Hudson can be configured entirely from its friendly web GUI with extensive on-the-fly error checks and inline help. There’s no need to tweak XML manually anymore, although if you’d like to do so, you can do that, too.

3.

Big difference comes here. The GUI providing by Cruise control for configuration is not at all good. It just displays the config.xml file. :( Its no way near to Hudson for Configuration GUI part. If you want to configure Cruise Control then you must study about the structure of the Config.xml first.
4 Change set support: Hudson can generate a list of changes made into the build from CVS/Subversion. This is also done in a fairly efficient fashion, to reduce the load of the repository.

4.

Cruise control also show the list of files which are changes at this check-in process.
5 Permanent links: Hudson gives you clean readable URLs for most of its pages, including some permanent links link “latest build”/”latest successful build”, so that they can be easily linked from elsewhere.

5.

Uhm… Cruise control is not giving this. It gives a link with some log code number attached with it. Its looking horrible and cant be easily likable.
6 RSS/E-mail/IM Integration: Monitor build results by RSS or e-mail to get real-time notifications on failures.

6.

It also gives RSS and email functionality. Don’t know about IM support. If we need to change the Email structure then either we have to change XSL or CSS file which we are using in the email config.
7 After-the-fact tagging: Builds can be tagged long after builds are completed

7.

N.A.
8 Detect new failing tests while build 8 Failing tests will show in the dashboard. But no separation between new and old.
9 Notify when first test in build fails 9 No such type of notification.
10 JUnit/TestNG test reporting: JUnit test reports can be tabulated, summarized, and displayed with history information, such as when it started breaking, etc. History trend is plotted into a graph.

10

It is showing all the unit test results but not as good as Hudson does. There is no detailed information like when it started breaking, History etc. and no graph for unit results too.
11 Distributed builds: Hudson can distribute build/test loads to multiple computers. This lets you get the most out of those idle workstations sitting beneath developers’ desks.

11.

The build distribution is done through the maven install goal. Its
12 File fingerprinting: Hudson can keep track of which build produced which jars, and which build is using which version of jars, and so on. This works even for jars that are produced outside Hudson, and is ideal for projects to track dependency.

12.

No idea.
13 Plugin Support: Hudson can be extended via 3rd party plug-ins. You can write plug-ins to make Hudson support tools/processes that your team uses.

13.

Plug-ins are there in Cruise control also.
14 Dash board: Hudson has an attractive dashboard with Colorful as well as meaningful icons. We can separate this building projects into subgroups also. It will also shows building projects. Well designed Ajax pages.

14.

It gives an attractive Dash board. It displays all the necessary information which we need to know. We can directly build from there also. Viewing/ downloading the log file is also allowed from this Interface.
15 Local Copy of projects: Handled by Hudson itself. No need to do by the user.

15.

Maintaining a local copy with the exact SVN data makes us more uncomfortable. The user has to copy the Project into the local folder with SVN data.
16 Auto copy of SVN updates: No need to provide any other code to copy the project from SVN to the local compiling folder.

16.

Its not copying the data from the SVN directly. We need to write (In our case we wrote an ANT build file to download the latest copy of Project from SVN) something separate.
17 Running In background: If the server where we deployed the war is running then its okay for Hudson.

17.

If we want to run it without console then we need to make it a separate ‘WINDOWS Service’ using any third party tool.
18 We can deploy the war file in any of the server we wanted.

18.

Jetty server is using internally.
19 User authorization schemes. more configurable.

19.

User authentication is there but no schemes at all.
20 Very Active mailing list.

20.

From a long period people are using this. So it gives so many search results. But its mailing list is not that much active when compared with Hudson.

Conclusion:

In my opinion Hudson much more better than Cruise Control. The time we will take to start to use Cruise control will be high when we compared with Hudson. The GUI which makes all the Configurations very very easy. The Ajax support makes the configuration more “Error Free”. Though Cruise control is using by a lot of people, when we looked into the features, mailing list, the fastness and support from Developers I think Hudson will be a good option.

Resources: lijinjoseji