Tuesday, April 21, 2009

Difference between Design Pattern & Framework

A framework is a set of collaborative classes for a specific application that can be reused (API) following a predefined design.

A general specification that is collection Of classes and Interfaces APIs that are designed to work together to handle a particular type of Problem. Framework is a skeleton of code used for developing an application.

Eg: Struts based framework
(Action Classes, Configuration Files) grouped together called Framework

a framework is a finite solution that help you structure your code and solve a particular kind of problems. A framework is usually made of several patterns implementation. A framework is based upon the IoC (Inversion of Control) principle; your application just need to provide and declare some callback functions and start the framework. From there the framework is in charge of running the application, calling your callback functions whenever it's necessary. So as you can see, they are very different concepts, the main difference being that a framework is a physical and usable piece of code while a pattern is a logical design solution to a given kind of problem.

Design Pattern :

Best practice for solving a common problem.

Design Patterns is a solution for recursively occured problem. These patterns wont have sperate API.

A Design pattern is a way of doing common things in a special way .Each known pattern has evolved from the failures of many programs that had been written in various domains.The most effective way of dealing with a problem is documented in a given style recommended by GoF (Gang of Four). The patterns themselves are useless is not applied properly and needs some experiance in writing solutions and different scenarious has to be taken in mind. The pattern that is in close resemblance with the problem at hand is the pattern to work with. Patterns are tried and tested ways of writing programs better but dont be too hasty to apply them with a blind eye. They need patience and a sharp eye of distinction. Patterns are also related closely with the logic and the code.

A pattern may not be restricted to programs only. It extends to the database level too.

No comments:

Post a Comment

Express you views