Jack is Here, asp.net findings

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘user’

Design your Website SEO Friendly

Design your Website SEO friendly, Everyone’s waiting to see your Business Website.

More realistic and around the many folk use of the Internet, but the numbers are growing trivial. The Internet has been a lot, but also because of this, the network site must always be a better substance and decrees, in its network of Web images to visit their website at what measures should be involved in the implementation of a major source of user data network design in the Act have their own Web sites more attractive around the reality of users? Here is a listing of the network model that may be encountered and activities to be considered.

Availability of basic features

First of all, a website design patterns, compatible with any browser. It should be able to make HTML and CSS validation testing. Second, the website should be able to provide users with disabled. This will not be an architect adhere to Web standards, as a long-term trouble. Thirdly, browse My Network Places program should be very easy for all users. No user like to see an old place, so he or she is to see how the distance around the sail. Fourth, the location should be easy to bar. This shows that the link destination as a pointer to be moved. The new position on the page is displayed as it is too loaded.

Appearance of the pages

There are four factors to take up the site shows. They are fonts, tone, art, and writing. The font is not just a question of personal direction of the user and architect. The main importance of the font selection is that it affects how fast the user can understand the data being submitted. Arial font is usually recommended in the new era of Roman and Arial.

Tone when power is applied, there is significant enough to be legible contrast between background and foreground there is a decree of the material. To achieve maximum contrast, you will need to use the background color of dark to light textbooks. Must be established by setting the basic color of the link. When the artwork, bear in mind is to go for an overloaded excessive consumption of too many images on some pages.

As often as potential, consumption artwork simply to back the substance being presented to users. A plenty of folk really have the trend to close away the images when browsing for data.

Web designers should remember the distinction between writing for the web and writing for print. Web content should be short and straight to the point.

Site performance

There are three factors that decide the whole operation of a network place. These are velocity, tables, and connections. Since everyone is hankering for much bandwidth, the better that designers can make is to avert the utilization of pattern that will go upward overly often bandwidth, because not every user has approach to tight Internet connections. To avert making the place seem like it takes always to download, avert loading putting an entire page inside a board.

Instead, the site divided into multiple tables. Web designers should not obscure the fact a site with excessively additional objects for the simple reason that each element requires a clear browser for the entire page to be downloaded.

The occurrence of bugs

In the class of mistakes, no one is willing to let his structural defects. To avoid this situation, the system should be established to compare the textbook font size up. One is to have a user who is there poor eyesight, they will take care to adapt to the Act, through its private sector to set the font size for more understanding of the textbook. Comparison of the value of this will be recommended that:

Font-size: -1

or

font-size: 100%

In lawsuit of URLs, it should be easy and brief, containing no punctuation or spaces. Users should be capable to duplicate an URL and glue it into email content without it being wrapped in dual lines. To avert asleep links, redirects should be established, in decree to avert the breaking of bookmarks and links. Web designers should have certain that navigation features will be existing at all times, whatever the size of the window the user is using. Browser windows should be maximized when applying pattern, because not every user will be surfing the Internet in a maximized window.

For More Details,

http://www.vp-website-design.com

Command Design Pattern

?

To perform several tasks paticipants pattern is to separate the following command:

Client – Who will do the task (our program, such as main (…) method will)
Invoker?- Who initiates a task
Receiver – Who listenes to the?command and carries out the?task.
Command?- interface for execution between invoker and receiver.
ConcreteCommand – implementation of Command. Holds the parameters required?to carry out the operation.

Now on the code snippet below (from GOF look http://www.dofactory.com/Patterns/PatternCommand.aspx taken)

// Command pattern — Real World example

using System;
using System.Collections;

namespace DoFactory.GangOfFour.Command.RealWorld
{

??// MainApp test application

??class MainApp
??{
????static void Main()
????{
??????// Create user and let her compute
??????User user = new User();

??????user.Compute(‘+’, 100);
??????user.Compute(‘-’, 50);
??????user.Compute(‘*’, 10);
??????user.Compute(‘/’, 2);

??????// Undo 4 commands
??????user.Undo(4);

??????// Redo 3 commands
??????user.Redo(3);

??????// Wait for user
??????Console.Read();
????}
??}

??// “Command”

??abstract class Command
??{
????public abstract void Execute();
????public abstract void UnExecute();
??}

??// “ConcreteCommand”

??class CalculatorCommand : Command
??{
????char @operator;
????int operand;
????Calculator calculator;

????// Constructor
????public CalculatorCommand(Calculator calculator,
??????char @operator, int operand)
????{
??????this.calculator = calculator;
??????this.@operator = @operator;
??????this.operand = operand;
????}

????public char Operator
????{
??????set{ @operator = value; }
????}

????public int Operand
????{
??????set{ operand = value; }
????}

????public override void Execute()
????{
??????calculator.Operation(@operator, operand);
????}

????public override void UnExecute()
????{
??????calculator.Operation(Undo(@operator), operand);
????}

????// Private helper function
????private char Undo(char @operator)
????{
??????char undo;
??????switch(@operator)
??????{
????????case ‘+’: undo = ‘-’; break;
????????case ‘-’: undo = ‘+’; break;
????????case ‘*’: undo = ‘/’; break;
????????case ‘/’: undo = ‘*’; break;
????????default : undo = ‘ ‘; break;
??????}
??????return undo;
????}
??}

??// “Receiver”

??class Calculator
??{
????private int curr = 0;

????public void Operation(char @operator, int operand)
????{
??????switch(@operator)
??????{
????????case ‘+’: curr += operand; break;
????????case ‘-’: curr -= operand; break;
????????case ‘*’: curr *= operand; break;
????????case ‘/’: curr /= operand; break;
??????}
??????Console.WriteLine(
????????”Current value = {0,3} (following {1} {2})”,
????????curr, @operator, operand);
????}
??}

??// “Invoker”

??class User
??{
????// Initializers
????private Calculator calculator = new Calculator();
????private ArrayList commands = new ArrayList();

????private int current = 0;

????public void Redo(int levels)
????{
Console.WriteLine (the
??????// Perform redo operations
??????for (int i = 0; i < levels; i++)
??????{
????????if (current < commands.Count - 1)
????????{
Command command = command [command] to the present;
??????????command.Execute();
????????}
??????}
????}

????public void Undo(int levels)
????{
??????Console.WriteLine(“n—- Undo {0} levels “, levels);
??????// Perform undo operations
??????for (int i = 0; i < levels; i++)
??????{
????????if (current > 0)
????????{
Command command = commands [- current] as Command?
??????????command.UnExecute();
????????}
??????}
????}

????public void Compute(char @operator, int operand)
????{
??????// Create command operation and execute it
??????Command command = new CalculatorCommand(
????????calculator, @operator, operand);
??????command.Execute();

??????// Add command to undo list
??????commands.Add(command);
??????current++;
????}
??}
}

?

Here Main(…) is the client

Client asks User (Invoker) to carry out some task (Calculations by Compute(…) method)

?? User knows about Calculator (Receiver) who will do the calculation and command which is an interface to call the required calculation operation (Execute or Unexecute).
But that calculation should be made known to the client. Client calls (orissues?commands)?User to do some +, – , *, / operations.

User records these commands in an array and calls command.Execute or UnExecute. the implementation(CalculatorCommand) knows well how to do the opertaion.

* Now here comes the use of credentials. If you need to revert to some level the user has a record of what commands were issued. We call only the receiver (CalculatorCommand) to carry out the same instructions in reverse.

?Uses for the Command pattern

Command objects are useful for implementing:

Multi-level undo :? If all user actions in a program are implemented as command objects, the program can keep a stack of the most recently executed commands. When the user wants to undo a command, the program simply pops the most recent command object and executes its undo() method.

Transactional behavior? Undo is perhaps even more essential when it’s called rollback and happens automatically when an operation fails partway through. Installers need this and so do databases. Command objects can also be used to implement two-phase commit.

Progress bars? Suppose a program has a sequence of commands that it executes in order. If each command object has a getEstimatedDuration() method, the program can easily estimate the total duration. It can show a progress bar that meaningfully reflects how close the program is to completing all the tasks.

Wizards? Often a wizard presents several pages of configuration for a single action that happens only when the user clicks the “Finish” button on the last page. In these cases, a natural way to separate user interface code from application code is to implement the wizard using a command object. The command object is created when the wizard is first displayed. Each wizard page stores its GUI changes in the command object, so the object is populated as the user progresses. “Finish” simply triggers a call to execute(). This way, the command class contains no user interface code.

GUI buttons and menu items? In Swing and Borland Delphi programming, an Action is a command object. In addition to the ability to perform the desired command, an Action may have an associated icon, keyboard shortcut, tooltip text, and so on. A toolbar button or menu item component may be completely initialized using only the Action object.

Thread pools? A typical, general-purpose thread pool class might have a public addTask() method that adds a work item to an internal queue of tasks waiting to be done. It maintains a pool of threads that execute commands from the queue. The items in the queue are command objects. Typically these objects implement a common interface such as java.lang.Runnable that allows the thread pool to execute the command even though the thread pool class itself was written without any knowledge of the specific tasks for which it would be used.

Macro recording? If all user actions are represented by command objects, a program can record a sequence of actions simply by keeping a list of the command objects as they are executed. It can then “play back” the same actions by executing the same command objects again in sequence. If the program embeds a scripting engine, each command object can implement a toScript() method, and user actions can then be easily recorded as scripts.

Networking? It is possible to send whole command objects across the network to be executed on the other machines, for example player actions in computer games.

Parallel Processing? Where the commands are written as tasks to a shared resource and executed by many threads in parallel (possibly on remote machines -this variant is often referred to as the Master/Worker pattern)

Mobile Code? Using languages such as Java where code can be streamed/slurped from one location to another via URLClassloaders and Codebases the commands can enable new behavior to be delivered to remote locations (EJB Command, Master Worker)

?

?

?

References:

GOF official site:
http://www.dofactory.com/Patterns/PatternCommand.aspx

Wikipidea
http://en.wikipedia.org/wiki/Command_pattern