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.