Tuesday, September 29, 2009

URI, URL, URN

Have you ever carefully noticed the string in the address bar of your browser? What is it? Is it a URI or URL or URN? Some of us can’t differentiate between URI and URL and URN. Some non technical persons even don’t know the terms URI and URN. They just call that string a URL. Let’s understand this concept in deep.

Full Forms:

URI - Uniform Resource Indicator
URL - Uniform Resource Locator
URN - Unifrorm Resource Name

Definition:

URI: A URI indicates the name and the address of the resource on the web. The URI is further subdivided into URL and URI. It means URL and URI are the components of URI. definition

URL: A URL is the address of some resource on the web. A URL defines how the resource can be obtained and from where it can be obtained.

URN: A URN is the name of some resource on the web. A URN does not imply the availability of the identified resource and never tells about how the resource can be obtained.

So, one can say URI = URL + URN

Example:

If i say “My name is Roy”, then it will be a URN, just telling the name of a person not the proper location.
If i say “I live in New York”, then it will be a URL, telling me the location of a person.
If i say “My name is Roy and I live in New York”, then its proprer URI.

Ambiguity: Its the matter of ambiguity whether the term URL is deprecated or not. Some argue yes and some no. Some say that the more correct term is URI, used in technical documentation. All URIs are means to access a resource on the Internet and are a technical short hand used to link to the resource. URIs always designate a method to access the resource and designate the specific resource to be accessed. So should we use the term URI instead of most popular term URL?

Conclusion:

URI is an abstract concept while URL and URN are the concrete implementations of a URI and one should always know the difference among all the three.

Monday, September 28, 2009

What is difference between n-tiered and n-layered

Tiered is physical separation, for example client tier, database tier, application server tier
Layered is logical separation, for example presentation layer, business layer, DAO layer.

Thursday, September 17, 2009

OOP principal

The first five principles are principles of class design. They are:
SRP The Single Responsibility Principle A class should have one, and only one, reason to change.
OCP The Open Closed Principle You should be able to extend a classes behavior, without modifying it.
LSP The Liskov Substitution Principle Derived classes must be substitutable for their base classes.
DIP The Dependency Inversion Principle Depend on abstractions, not on concretions.
ISP The Interface Segregation Principle Make fine grained interfaces that are client specific.

The next six principles are about packages. In this context a package is a binary deliverable like a .jar file, or a dll as opposed to a namespace like a java package or a C++ namespace.

The first three package principles are about package cohesion, they tell us what to put inside packages:

REP The Release Reuse Equivalency Principle The granule of reuse is the granule of release.
CCP The Common Closure Principle Classes that change together are packaged together.
CRP The Common Reuse Principle Classes that are used together are packaged together.

The last three principles are about the couplings between packages, and talk about metrics that evaluate the package structure of a system.

ADP The Acyclic Dependencies Principle The dependency graph of packages must have no cycles.
SDP The Stable Dependencies Principle Depend in the direction of stability.
SAP The Stable Abstractions Principle Abstractness increases with stability.

Wednesday, September 9, 2009

What is architecture

Fowler statement:

In most successful software project, the expert developer working on the project have a shared understanding of the system design. The shared system design is called "Architecture". The shared understanding includes how the system is divided into components and how those components interacts through interfaces. Those components are usually composed of small components, but the architecture only includes those components and interfaces that understandable by all developers. Architecture is about important stuff, whatever is.

Booch said:

All architecture are design, but not all design is architecture. Architecture represents the significant design decision that shapes a system where significant is measured by the cost of change.

The goal of architecture is eliminate the impact and cost of change.


Making everything easy to change makes the entire system complex.