Definition of a pattern

Source: Internet
Author: User

A pattern is a named organized message that captures the essential structure and meaning of a solution that contains a problem with the relevant forces in a certain context (scene), which proves to be successful.
The essence of the pattern is the solution to the balance of concerns in a given scenario.

  What is a pattern?

1) mode, which is pattern. is actually the methodology to solve a certain kind of problem. You summarize the method of solving a certain kind of problem to the theoretical height, that is the pattern.


There are different fields in the model, there are architectural patterns in the architecture field, and design patterns in the field of software design. When a field matures, many patterns naturally arise.

What is a framework?
framework, which is the frame. is actually an application of semi-finished products, is a set of components, for you to choose to complete your own system. Simply put, use someone else's stage, and you'll do the show. Moreover, the framework is generally mature and constantly upgraded software.

2. Why use patterns?
because the pattern is a guide, under a good guide, help you to complete the task, help you to make a good design plan, achieve a multiplier effect. And will get the best solution to the problem.

Why use frames?
because the development of software systems to today is very complex, especially server-side software, design to the knowledge, content, too many problems. Using other people's mature frameworks in some ways is tantamount to letting others do some basic work for you, and you just need to focus on the business logic design of your system. And the framework is generally mature, robust, he can handle a lot of details of the system, such as things, security, data flow control and other issues. And the framework is generally used by a lot of people, so the structure is very good, so the extensibility is also very good, and it is constantly upgraded, you can directly enjoy the benefits of others to upgrade the code.
frameworks are typically in the middle tier between low-level application platforms (such as Java EE) and higher-layer business logic.

Why should the software be layered?
in order to achieve "high cohesion, low coupling". Divide the problem into various solutions, easy to control, easy to extend, easy to allocate resources ... In short, a lot of benefits:).

3. The following are mainly the java,j2ee aspects of the model and framework:
What are the common design patterns?
first of all, you need to understand that Gof's "design model-reusable object-oriented Software Foundation" book (this can be said that the programmer must), note: Gof is not a person, but refers to four of people. Its original intention is gangs of four, is "Gang of four", refers to this book of four Erich Gamma,richard Helm,ralph Johnson,john vlissides. This book covers 23 main models, including: Abstract factory, adapter, appearance mode, etc.
There are many other models that are estimated to have more than 100 kinds.

There are too many software design patterns, so just say the most common MVC pattern for my understanding.
The MVC pattern was presented by Buschmann in 1996:
model: Encapsulates data and all operations based on that data.
View: Is the encapsulation of the data display, that is, the user interface.
controller: Is the encapsulation of external action on the model and the flow of data control.

In addition:
RUP (Rational Unified process) software unification processes, XP (Extreme programming) Extreme programming, these are often called "process methods", is a software project implementation process of methodology, It is a method strategy for the implementation process of software project. is also the pattern of another angle.

4. What are the common Java frameworks?
WAF:
Full Name: WEB application FRAMEWORK
main application: EJB layer, (web layer also, but relatively weak).
main application technology: EJB, etc.
Source: http://java.sun.com/blueprints/code/index.html
Description: This is the framework of the example Petstore (pet store system) used by Sun to showcase the Java EE platform. Is the application framework proposed in the Sun Blue Book Example program. It implements MVC and other good design patterns. Sun's web site has technical information, it is best to download Petstore to study, WebLogic bring this system, the source code in Bea\weblogic700\samples\server\src\petstore. This is the preferred framework for learning about the Java EE.
free.

Struts:
main application aspect: Web layer.
main application technology: Jsp,taglib,javabean,xml, etc.
Source: http://jakarta.apache.org/struts/index.html
Description: This is Apache's Open source project, which is now widely used. Based on the MVC pattern, the structure is very good, based on JSP. The production of STRUTS1.02 has been integrated in the Jbuilder8.
free.

a brief introduction to the Waf+struts combination: The Web layer uses the STRUTS,EJB layer with WAF:
JSP (TagLib)?? >actionform?? >action?? > Event?? >ejbaction?? >ejb?? >dao?? >database JSP (TagLib) (forward) <??  Action <?? eventresponse<?? Turbine:
main application aspect: Web layer.
main application technology: servlet, etc.
Source: http://jakarta.apache.org/turbine/index.html
Description: This is Apache's Open source project. Based on servlet. It is said that the speed is relatively fast, based on the service (pluggable implementation pluggable actor) to provide a variety of services.
free.

COCOON:
main application aspect: Web layer.
main application technology: Xml,xsp,servlet, etc.
Source: http://cocoon.apache.org/2.0/
Description: This is an open source project for Apache. Based on XML, XSP (in layman's words, XSP is a dynamic XML document that is formed after a Java program segment is added to an XML static document. )。 Features can interact with a variety of data sources, including file system, database, Ldap,xml resource library, network data source and so on.
free.

ECHO:
main application aspect: Web layer.
main application technology: servlet, etc.
Source: http://www.nextapp.com/products/echo/
Brief Introduction: An open source project of Nextapp company. Based on servlet. The page can be done beautifully, combined with echopoint, can make a lot of graphic effects (inside with the Jfreechart package). Use the idea of SW ing to make a Web page, using HTML as a Java class. However, a lot of use of the session, page frames (frame) Many, system resource consumption is very large.

Definition of a pattern

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.