Monday, March 15, 2010

Difference: Design Pattern, Framework, Architecture & Methodology

Design Pattern : Design Pattern is a tried and tested solution to a specific & common design problem. The design pattern suggests how you will organise your classes and methods to do a specific activity. This is a generic model and can be used anywhere in the application. A design pattern has a name, motivation (goal for using the pattern), problem scenario, consequence (side affects and trade-offs of using the pattern) etc. Eg - Java APIs use design patterns like Decorator. 
Struts framework also uses design patterns. Design patterns are best practices for designing applications & also to avoid silly object oriented design mistakes.


Framework: Is a generic solution built for specific kind of solutions. such as web applications, web services. A framework is not just a collection of classes and intefaces with API exposed but one of the critical aspects is a framework is extendible to build custom application. There is a slight difference between products and frameworks. Product does a specific work and not extensible where as framework is. Framework is implementation of modelling  so it is a ready to use solution. Eg - Struts, ORM Hibernate framework

Architecture: Architecture at very highest level is how/which components are placed where. This is contextual. For example: if you are defining system architecture then you will define which technologies to be placed how and where. If you are defining application architecture then you will specify which application components are placed how and where? Architecture definition involves identifying tiers and further different layers to separate each unit responsibility.  Eg- MVC Architecture(Used in Struts, JSF, Spring, Swing etc) 

Frameworks are based on architectures.

Methodology: is used to structure, plan and control the process of development of the application. 

Design methodology is more about the manners to do a specific activity. you may follow specific SDLC methodology to run the complete project, you may follow an architecture methodology (Architectural pattern such as Zachmann, Togaf, DOD) for defining architecture. you may follow specific test methodology for testing process and so on.




 So, most abstract is Architecture, Frameworks are based on architecture. Framework uses design patterns to keep design problems at bay. Methodology takes care of the process flow.


                         
           
                         uses                                                       has
Architecture --------> Framework  -------- Design Patterns         
             most abstract                                        least abstract

No comments:

Post a Comment