Monday, April 21, 2008

.NET metadata


.NET Metadata
From Wikipedia, the free encyclopedia

.NET metadata refers to certain data structures embedded within the Common Intermediate Language code that describes the high-level structure of the code. Metadata describes all classes and class members that are defined in the assembly and all class that will be called for. The metadata for a method contains the complete description of the method, including the class, the return type and all of the method parameters.

A .NET language compiler will generate the metadata and store this in the assembly containing the CIL. When the CLR executes CIL it will check to make sure that the metadata of the called method is the same as the metadata that is stored in the calling method. This ensures that a method can only be called with exactly the right number of parameters and exactly the right parameter types.


Developers can add metadata to their code through attributes, custom and pseudo custom attributes.

A custom attribute is a regular class that inherits from the Attribute class. A custom attribute can be used on any method, property, class or entire assembly with the syntax: [Attribute name(optional parameter, optional name=value pairs)]

A pseudo-custom attribute is used just like regular custom attributes but they do not have a custom handler; rather the compiler has intrinsic awareness of the attributes and handles the code marked with such attributes differently.

Wednesday, April 16, 2008

Design Consideration for Java Applet


Java Look and Feel Design Guidelines, second edition.

Copyright 2001. Sun Microsystems, Inc. All Rights Reserved.

When establishing applications, we need to consider delivery, accessibility to user, and suits a global audience with minimal effort to localize.

When deciding between an application and an applet, the two main issues you need to consider are distribution and security, including read and write permissions. For applet we must also decide whether to display it in the user's current browser window or in a separate browser window.

Distribution
It is simple for applet, users can access the latest version of the applet from anywhere on the Internet, but the applet must be downland and re-start at the browser each time they needed it. But the browser required to have the JFC or JavaTM Plug-In, or we may need to consider to provide plug-in and non-plug-in configurations for user access.

Security
Applet cannot read or wirte from user's hard disk, they are for displaying web information only, it can be front end for system database.

Placement
For applet we must also decide whether to display it in the user's current browser window or in a separate browser window.

Applet display in the same window
It is suited for users perform a single task and should not include a menu bar which confuses users.

Applet display in the separate window
When the applet involved more than one task. Try to avoid confusion between the browser's menu and controls and the applet's menus and controls. We also need to avoid potential conflicts between mnemonics in the two windows.

Thursday, April 10, 2008

LAMP Architecture


Building Scalable Web Architectures
Aaron Bannert
aaron@apache.org / aaron@codemass.com

LAMP combines Linux, Apache, MySQL, PHP or Perl. It is a layer sturcture just like other web architectures.

The outmost layer to direct connect to Internet is the External Cache layer.
It can be Squid, Apache's Mod_proxy or commercial HTTP accelerator

The web server Tier can be make up of Apache, thttpd, Tux Web Server, IIS, Netscape.
It should have a lot of memory.

Application server Tier provide decoupling code into distrinct services, which may reduce the chance for process bottlenecks.

Database Tier, may use free open source product or commercial product to hand data storage and retrieval.

Internal cache Memcache is suggest becuase it is a distributed cache system and use to store short-lived objects from web or application tier.

It provides load balance for HTTP Caches and Servers, App Servers, and DB Slaves.

LAMP provides Scalability, reliability, low cost, flexible, extandable even for large systems. It allows grow in small steps, stay up when it counts, can grow with needs, have rooms for future expension, low cost used mainly open source applications, high Quality of Service (fast page load), Minimal Downtime, Stability, Redundancy, and Resilience.

Monday, March 17, 2008

Support for AJAX - Microsoft

ASP.NET AJAX Overview

AJAX features is alreay provided in Microsoft ASP.NET.
AJAX scripting compatable with most frequently used browsers
(including Microsoft Internet Explorer, Mozilla Firefox,
and Apple Safari).
ASP.NET 2.0 AJAX already becomes standard features from Microsoft product,
The latest one is ASP.NET 3.5. ,
For new production Like Visual Studio 2008, SharePoint also comes with such capabilities, so that in the near future Microsoft is will going to support AJAX.

Sunday, March 16, 2008

Python Database framework - PyDbLite

PyDbLite - a small & fast in-memory database engine - PyDbLite.pyAuthor: Pierre Quentel

While preparing the AJAX project and looking for database solutions, PyDbLite
is one of the possible optional. PyDbLite is a pur-Python in-memory database
engine, use list as query language. It is very simple and easy to implement,
but it will take up memory to hold the database, so it is not suitable for a
large scale database application.

It comes with a Base class and allow us to to create, open, update, delete, query the
database and create index for the database file we need. While creating the database, we do not have to defind data type. PyDbLite will accept any value that can be serialized by the cPickle module.

>> code samples <<
Complete reference

from PyDbLite import Base
db = Base('dummy')
db.create('name','age','size',mode="open" )
db.open()
db.insert(name='homer',age=23,size=1.84)
db.commit()
recs = [ r for r in db if 30 > r['age'] >= 18 and r['size'] < 2 ]

for r in (r for r in db if r['name'] in ('homer','marge') ):
do_something_with(r)

for r in db:
do_something_with(r)

db.create_index('age')
records = db._age[23]
len(db)
db.delete(record)
db.update(record,age=24)
db.add_field('new_field'[,default=v])
db.drop_field('name')
db.fields

Monday, March 10, 2008

Introduction to Ajax framework


http://en.wikipedia.org/wiki/Ajax_framework


AJAX framework helps to develop web applications that using Ajax. The goal of the framework is to provide the Ajax engine to help develop server and client-side functions.

There are a lot of different framework available on the net, they are open source and free. Such as:-


Dojo Toolkit
, Modular JavaScript toolkit,


Prototype
, a JavaScript framework that provides Ajax and other utilities


Mootools
, a compact and modular JavaScript framework best known for its visual effects and transitions


Script.aculo.us
, Used with the Prototype Framework, mainly for animations and interface development

Thursday, March 6, 2008

Javascript Overview

http://en.wikipedia.org/wiki/JavaScript

Javascript is a script language, used to provide functions that can be embedded or included in HTML documents. It supports most of the syntax from C like if, while, switch etc... It provides dynamic typing, the type of the variable is determined by the value, so we can change the type of the variable by assigning different types of value to it. Objects are associative arrays, such that the representation of an object object.x is equivalent to object["x"], so the values within the object can be add, change or deleted. Javasrcipt use prototypes instead of class when defining object properties, functions and method are the same, but if the function is call with an object, the this keyword is refer to the originated object.

Javascript support variadic functions, which is an indefinite number of parameters can be passed to a function. The function can both access them through formal parameters and the local arguments object. JavaScript also support regular expressions, which provide a concise and powerful syntax for text manipulation that is more sophisticated than the built-in string functions.

In order to execute Javascript, the browser who runs it must comes with a JavaScript engine, an interpreter, to interpret JavaScript source code and executes the script accordingly, since not all the browsers can run the JavaScript, so when we may need to test the compatibility of the browser before running the script.

Javascript mostly run at client's browser, client side application, so it can provide a quick response to user's action and is capable of detecting the user's action like keystrokes input, for which HTML alone is not able to handle it.

The web server, server side application, is another common application of the engine. A JavaScript webserver would expose host objects, typically created by public API, representing a HTTP request and response objects, which a JavaScript program could then manipulate to dynamically generate web pages.

JavaScript and the DOM provide the potential for malicious attack, including cross-site scripting. To counter the risk like that, first, scripts run in a sandbox in which they can only perform Web-related actions, not general-purpose programming tasks like creating files. Second, scripts are constrained by the same origin policy: scripts from one Web site do not have access to information such as usernames, passwords, or cookies sent to another site. Third, stick to the same origin policy.

Friday, February 29, 2008

Load Balancing Web Applications

by Vivek Viswanathan
09/28/2001

http://www.onjava.com/pub/a/onjava/2001/09/26/load.html?page=1

A cluster is a group of servers running a Web application simultaneously, appearing to the world as if it were a single server. To balance server load, the system distributes requests to different nodes within the server cluster, with the goal of optimizing system performance. This results in higher availability and scalability -- necessities in an enterprise, Web-based application. High availability provided by redundant resources. Scalability is an application's ability to support a growing number of users.

DNS round robin and Hardwaer load balancers are the two main methods available to balance a server load.

For DNS round robin, duplicate servers are required to form a cluster, each server
within the cluster takes their turn to answer incoming request. It is simple, easy to setup and inexpensive. However, it cannot support server affinity. This method balance the number of connection to each server not the actual loading.

For hardware load balancer: It use a virutal IP to represent the the IP of all servers in the cluster. When a request comes to the load balancer, it rewrites the request's header to point to other machines in the cluster. If a machine is removed from the cluster, the request doesn't run the risk of hitting a dead server, since all of the machines in the cluster appear to have the same IP address. This address remains the same even if a node in the cluster is down. It provides server affinity and high availability throught failover.

Tiered Software Architectures

http://www.sei.cmu.edu/str/descriptions/clientserver_body.html

Client/server architecture (2 tier architectures).
This approach split the processing management between the user system interface environment and the database management server environment. The client initiate the request (Remote procedure call or SQL ) sent to the server, and the servers respond to client with the answer.
This is good at providing distributed computer within a small size network, may be upto 100 simultaneous connections. If more than that, performance will deteriorate due to process of sending the "keep-alive" message. Furthermore, using proprietary databse restricts flexibility and choice of DBMS for application, it is not portable between different paltforms.

Three tier architectures is also referred to as the multi-tier architecture, a middle tier was added between the user system interface client environment and the database management server environment to perform queuing, application execution, and database staging. In addition the middle layer adds scheduling and prioritization for work in progress. There are a variety of ways of implementing this middle tier, such as transaction processing monitors, message servers, or application servers. The three tier client/server architecture has been shown to improve performance for groups with a large number of users (in the thousands) and improves flexibility when compared to the two tier approach. Flexibility in partitioning can be a simple as "dragging and dropping" application code modules onto different computers in some three tier architectures. A limitation with three tier architectures is that the development environment is reportedly more difficult to use than the visually-oriented development of two tier applications.

(see more on Three Tier Software Architectures)

Author: Darleen Sadoski, GTE
Copyright 2007 by Carnegie Mellon University

Tuesday, February 5, 2008

Why Learn CGI?

http://www.oreillynet.com/pub/a/oreilly/web/news/cgi_0700.html

by Scott Guelich
07/01/2000

The advantages of using CGI
1. CGI is the most popular way to develop dynamic content
2. CGI is support by all major web servers
3. CGI is language independent
4. CGI was intentionally designed as a lightweight interface over HTTP
5. Numerous ISPs and homepage services allow CGI scripts.
6. CGI are easy to learn and used by programmers
7. There are a lot of on-line CGI resources.

Tuesday, January 29, 2008

Design Consideration for Web-based Applications

This paper was published in the 2001 Human Factors and Ergonomics Society's Annual Meeting proceedings. By Luke Wroblewski & Esa M. Rantanen

http://www.lukew.com/resources/articles/web_applications.html

While developing web applications we also need to follow standards to provide quality applications for all end users.

This document provides guidelines for effective design and implementation for web application including web services. "weblications"—a term first coined by Bruce Tognazzini (Norman, 2000)—are defined as serious software being delivered as a service over the Web (Nail, 1998).

In general, it is often the case that weblications are used more intensively and frequently than traditional web pages. Users want the services that weblications have to offer (Norman, 2000). Therefore, they are willing to invest more time in learning the functionality of a weblication for the payoff of increased productivity.

Guidelines
1. Use Full screen to focus users’ attention, hide all tools, menus and bars make the browser less confusing.
2. Minimize the use of windows, so won’t get lost behind other windows.
3. Emphasize the contents and makes the window less obtrusive.
4. Use consistent layout enhances usability.
5. Use rollovers, appropriate application make screen clear for reading. If overuse, may result in a flickering effect.
6. Use ALT-overs when the immediacy of a rollover is not needed.
7. Avoid double clicks. Users already get use to use single click for web interactions.
8. Use the conventions of link selection in web, since users already get use to it.
9. Use inherent functionality of visual elements, users already expect this from their interface.
10. Use both saturated and unsaturated link colors, let user easy to determine which link/service is already executed.
11. Use underlined fonts as hot-spots
12. Use pull-down menus, radio buttons, and checkboxes as utilized online.
13. Use plug-ins and frames as tools for weblication design. More functionality and richer form of interaction or information display.
14. Use motion cues and animation as a feedback mechanism.
15. Use common functionality between a weblication and web browsers. Save efforts.
16. Exploit the similarities in the basic functionality of all weblications. Promote standardization and eliminates problems from implementation of non-standardize interaction.
17. Utilize the resource potential of the web in the design of a weblication.
18. Manage time and workflow within a weblication. The resulting product will be more task-oriented, guide users through the actions necessary for task completion.
19. Consider the aesthetic integrity of the interface, Aesthetic presentation can give a weblication a personality, provide users enjoyment or familiarity, and a sense of trust and professionalism

Sunday, January 20, 2008

Lecture 1 summary - Browser summary W3School

Based on the static from w3school.com by 2007 Microsoft IE family got 55.9% share, where Firefox got 36.3% share, the share for Microsoft IE is droping where the pupolarity of Firefox is increasing for the passing 3 years.

Friday, January 18, 2008

CS5281 IAD my Firt Blog

THIS is my first blog after joining the class CS5281