Difference between Design Pattern & Framework


J2EE patterns: Difference between Design Pattern & Framework

  1. Hi, Can anybody tell the difference between a desgin pattern and a framework. Regards, Saravanan.K

    Threaded Messages (33)

  2. Check this thread ;-)[ Go to top ]

  3. Re: Check this thread ;-)[ Go to top ]

    Design pattern is an idea, Framework is generic implemention
  4. Design Patterns is a solution for recursively occured problem. These patterns wont have sperate API. Whereas the Framework comesup with set of APIs. Using these framework we can apply Design patterns also.
  5. Re: Check this thread ;-)[ Go to top ]

    Design Pattern is a specification of how to solve a commonly accoring problem. Framework is the implementation of one or more patterns with supported tools and APIs which can be used/plugged-in in order to implement the pattern in your application.
  6. Let me see, if I can answer this question with an example. I am not an expert on this, so please let me know, if I am wrong. My understanding is that: a Framework is a collection of patterns, along with associated tools and utilities. I have been thinking that I am creating a framework, which has following main patterns: (i). The first pattern is creating reusable Ajax GUI Classes. http://cbsdf.com/technologies/DHTML-Widgets/Widget-samples.htm http://cbsdf.com/technologies/misc-docs/GUI-Widgets.htm (ii). The second pattern is building “Component Factories� using the reusable Ajax GUI Classes. http://cbsdf.com/technologies/misc-docs/CF-Goog-Charts.htm http://cbsdf.com/technologies/component-factory.htm (iii). The third pattern is building larger and larger components using the “Component Factories� and finally the application. http://cbsdf.com/technologies/LC-CBSD.htm http://cbsdf.com/technologies/misc-docs/CF-LC-Figures.htm http://cbsdf.com/ps_blog/plug-n-play.htm Regards, Raju
  7. The two could be looked at different contexts. A design pattern suggests a solution for a recurring design problem in an application and the solution is generally open for future extensions. A framework is a suite of packages using which applications (or the logical layers of applications), with all the functional and non-functional requirements, can be developed and hosted. Thats the simplest difference, I could see.
  8. Hi,

    Can anybody tell the difference between a desgin pattern and a framework.

    A pattern is just a way of sharing knowledge, experience. It isn't a solution in itself. A pattern can have many different implementations refered as strategies and be implemented in many different programming languages. Patterns are popular because they are a very good way to use a common language, to document a system and to reuse some parts of a system design. Contrary to popular belief, it's very hard to reuse existing domain objects (see the "Object-oriented Code Re-use myth") but patterns are very easy to reuse accross different projects. On the other hand, 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. Well hope it helps. I had to write a paper on the subject not so long ago so it's still fresh in my memory.
  9. A framework is a product and a design pattern is a specification. Therefore a design pattern is part of your system design and a framework is part of your system. Maybe that's the main difference. Regards, nD
  10. 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 Framework on the other hand like the MVC framework is often made of a collection of patterns. A framework may/may not be composed of patterns. You may write your own patterns( ofcourse after u have gone through which are already there and that too has to be documented GOF way with an example) but a Design pattern is NEVER made up of framework. Thereby a framework is associated closely to a product. a change at the framework level means change in the product behaviour.But a change in the design pattern means change in logic or maybe replacement by another established pattern. A pattern may not be restricted to programs only. It extends to the database level too.But I dont know mcuh about it. For a classic reading about design patterns you should (not must) read Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley Professional Computing Series) by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. They are the GOF people or the Gang of Four. Design patterns nowadays have also been evolving at the J2EE level for example ServiceLocator, Front Controller. I hope this would help.
  11. What is the difference between Framework and Methodology?
  12. Pattern - Methodology[ Go to top ]

    A pattern is what all this guys explained to you. A methodology defines the way you are gonna do things. A few methodologies: MSF (Microsoft) Agile Software Development (this is more like a philosophy) SCRUM XP (Extreme Programming) these two last can combine and become quite powrerfull for me at least. It defines for example if you are gonna do something like that: ALL Requirements, then ALL Development, then ALL Testing, then ALL Implementation (alias installation) or something like this: SOME Requirements, then SOME Development, then SOME Testing, then SOME Implementation (alias installation) and repeat until the project finishes. Check MSF that is not an agile methodology on the internet and then XP that would be like the opposite to understand better. Hope this helps. Lorenzo.
  13. 1. Design Pattern is a proven way to solve a problem programmatically 2. Framework is a set of well designed components with the help of which applications can be built upon
  14. To add some notes to the other comments, a framework is built on top of design patterns, and thus, a framework imposes patterns for its correct usage. So you can see both are also related. “A design pattern is a proven solution for a recurring design problem that occurs within a contextâ€?. Please pay attention to the definition, the proposed solution can have different implementation alternatives, depending on the programming language or specific platform. For example, the J2EE design patterns propose a solution and implementation alternatives that may be suitable depending on what you are doing. However, the most important thing about a pattern is to understand what kind of problem solves, and that is why you should understand the problem context. If you misunderstand the context and the specific problems that the design pattern solves, then you can select and apply the wrong pattern and more problems can appear in your projects. In the other hand, I would like to quote the definition given in the RUP documentation about a framework, that I read some time ago, which I think is pretty comprehensive and accurate: "A framework is a partially built subsystem, for solving a specific problem and that must be instantiated for its usage". Every framework provides the basic building blocks for building your own systems according to your needs. These building blocks will be general for every problem, for example, reusable components ready to use, interfaces that define design contracts and horizontal services. What you have to add to the framework is what is particular to your need (that is the framework instantiation). I will add that every framework has its own purpose, best-practices, restrictions and limitations, and PLEASE READ THEM CAREFULLY AND GET EXPERIENCE APPLYING THEM. By experience, some frameworks are used for making things or solving needs, they were not designed for and so, users start having problems instead of getting the real benefits of using a proven, mature framework. Please also, pay attention to the maturity state of a framework. If a framework has been proven in several projects, it will do what you are expecting with high-quality, and what is more, it will evolve with its width customers using it. There are several frameworks, some can be conceptual others can be technological, there is no restriction, they all bring building blocks, for making your own systems, faster, easier and reusing best practices of a proven common infrastructure. To name a few technical frameworks: - Struts (http://struts.apache.org/) and JSF – Java Server Faces are frameworks for building Web Interfaces. They both use the MVC design pattern, which is maybe the most used architectural pattern for building frameworks and software intensive systems. Design patterns related with MVC are: PAC Pattern and IoC. - Toplink (www.oracle.com/technology/products/ias/toplink/) and Hybernate are frameworks for object persistence. - Log4J (http://logging.apache.org/log4j/docs/) is a framework for auditory. You can use Log4J for implementing technical logs and business audit logs. - J2EE its framework for building Enterprise Applications. Its building blocks are horizontal services that provide common infrastructure and well defined interfaces in its specifications (Servlets, EJBs, JDBC, JMS, JTA among others) for building your own applications. - LEAF - Lucasian Enterprise Application Framework (http://www.lucasian.com/framework) is a white-box framework for building Enterprise Java Applications with high productivity in development and robustness in production environments. LEAF is built on top of the J2EE Design Patterns framework and open-source frameworks such as, Log4J, Apache Axis and Jelly. LEAF provides common horizontal services for security, auditory and frameworks for concurrency, exceptions handling and QoS. LEAF is white-box framework because it provides code generation wizards through an Eclipse Plug-In that will generate specific application components using J2EE Design Patterns (Data Access Objects with the Abstract Factory Pattern, Value Objects, Composite Entity, Data Transfer Objects, EJB Façade, Read-Only Entities, and Business Delegates among other supported design patterns). White box means that you can see, change, extend and debug your own Java code instead of having interpreters or any kind of black-box engine, with dependency on vendor specific design patterns or infrastructure. The list is endless; however think about a framework as a partially built solution, built on top of design patterns, that imposes patterns for solving specific problems. In order to use the frameworks for building your own needs rapidly and with low risk, you should use its basic building blocks (reusable services, components, design principles, extensibility mechanisms) and understand its usage best practices and limitations. I really hope this comments will help Saravanan. Please feel free to post more questions and comments. Sincerely, Mauricio Naranjo
  15. The Frame work is provides a solution of the particular problem. Design pattern is a specification or guidelines to implement the particular problem.
  16. My name is robert, i think u won't tell from my email... Well, for me there is a sound difference between a framework and a design pattern. A framework is an "environment" that u create for a specific problem so that a solution might get out of it. The idea of environment implies a possible expansion, i.e. a framework is scalable... A design pattern is a "model" u follow in order to get a solution for a specific problem. But here, such a model is not limited to one unique problem... There is a possibility that another problem could be solved following the same pattern. Anyway, i guess this is enough... if you want me to say more, follow the link and i'll develop the idea i just posted. Regards, Robert N.
  17. On the same lines..... How is a Design Pattern different from Architecture ? Thanks a ton, Amit
  18. An example of a design pattern is the Java Beans method naming convention. Methods accessors are named get[Key]() and set[Key] where [Key] can be modelled as a feature name. The respective set and get methods for a given key are used to set and retieve state. The pattern in this case is the association of a get/set semantic to a method naming convention. A framework is simply a piece of software that deals with a one or semantic models. Another example is the pattern of declaring an objects deployment criteria in an inner context interface. For example: public class Demo { public interface Context { Color getBackground(); } public Demo( Context context ) { Color color = context.getBackground(); ... } } In the above example we have two patterns. Firstly there is the pattern concerning the declaration of operation criteria within a Context inner interface (which would require recognition by a framework). Secondly we have the Java Bean convention with respect to context object method names (get[Key]). An implementation class that deals with the problem of constructing a Context instance could be part of a framework. A framework would also deal with the overall management of the constructor, the object lifecycle and lifestyle, collection policy, activation rules, and so forth. For example - the ContextInvocationHandler class is a simple example of just such a framework class.
  19. FrameWork in general specifies collection Of classes and Interfaces that are designed to work together to handle a particular type of Problem. eg:-Struts Design Pattern refers to a repetable solution for a commonly occuring software problem eg:- DAO
  20. here[ Go to top ]

    Dessign Pattern is thinking; Framework is half product; Colin
  21. Perhaps someone could summarize the difference in the four key terms in this thread - Design Pattern, Framework, Architecture and Methodology
  22. FrameWork 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 Design Pattern In order to make a design (Architecture) of apllication we go for the many design patterns and clup together. A pattern describes a proven solution to a recurring design problem. Design patterns are used in the framework Eg: We are using the Stuts framework through persistence Layer design patterns. one example the persistence Layer pattern defined by group of design pattern community solve the particular problem. It may be in different way. A framework includes lot of design patterns.
  23. FrameWork 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 Design Pattern In order to make a design (Architecture) of apllication we go for the many design patterns and clup together. A pattern describes a proven solution to a recurring design problem. Design patterns are used in the framework Eg: We are using the Stuts framework through persistence Layer design patterns. one example the persistence Layer pattern defined by group of design pattern community solve the particular problem. It may be in different way. A framework includes lot of design patterns. Rgds Thomas M. Waltair
  24. Design Pattern : Design Pattern is a way to do things. The design pattern suggests how you will organise your classes and methods to do a specific activity. Framework: Is an 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 COTS products and frameworks. I would say that a product is to do a specific thing and not extendible. Architecture: Architecture at very highest level is how/which components are placed where. This is contextual. for ex: 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? Methodology: 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.
  25. Framework:Partly completed application that could be modified to cater our needs. Design Pattern:Solutions for some of the existing design flaws.
  26. Please correct if I am wrong anywhere.Actually a Framework is a collection or an API which is a cluster of classes,interfaces,etc to work for an application,whereas a Design Pattern is a Best Practice where we can achieve a best way of approach to resolve the issue.
  27. Framework: A framework is a set of collaborative classes for a specific application that can be reused (API) following a predefined design. Design Pattern Best practice for solving a common problem. Kind regards, mtstorm
  28. As I understand them, A Framework is something readymade solution avaible for your use as is or by extending or modifing. A Design pattern is a concept to tell how to do to accomplish a particular requirement or attach a problem.. I hope it helps... share your thoughts.. Yellappa
  29. Let me try to clarify it... Design pattern is just a concept. it can be thought as a proved solution for some specific type of problem in some specific context. here context is very much important pattern has nothing to do with any specific language or implementation. it can be implemented in differentlanguge.. in different way framework is an implementation of some patterns, to solve some specific type of problem in some specific context , frameworks are tightly bound with language. Sudhir Nimavat
  30. Architecture is modelling the system i.e. logical view and design pattern is part of architecture. Whereas Framework is physical view, set of Classes, Interfaces and implementation of patterns.
  31. Design pattern is a universally tried and tested solution that targets a particular and a common problem. It is sort of a template and is generally programming language agnostic. For example OOAD patterns can be used in any OO language such as C++, Java etc. A design pattern has a name, motivation (goal for using the pattern), motivation (problem scenario), consequence (side affects and trade-offs of using the pattern) etc. Framework on the other hand is sort of a software platform, or a base building block, on which applications are developed. Framework generally are unique to an organization or a domain (retail, middleware, finance) etc. and there is no hard and fast rule what the scope of a framework should be.
  32. Design Pattern Vs Framework[ Go to top ]

    And yeah, forgot to mention one thing - a framework generally consists of one or more design patterns, but the converse is not true.
  33. Design pattern means it i sthe solution for commonlly occuered problems in software developement.that means design patterns to be the "best-practices" that can be adopted when designing applications because they are highly optimized designs and time-tested to be effective. where as Frameworks are a collection of functionally related class libraries which can be used to implement some fuctionality in an application. These frameworks contain reusable code which is designed and optimized to provide specific features. Good examples of frameworks are are Java's Collections Framework, AWT, SWING, JSF, etc
  34. I think about "pattern" concept + The most abstract pattern is: Architecture + Design pattern is less abstract than Architecture + And Framework are the least abstract pattern