Technical analysis: What is a model? What is a framework?

Source: Internet
Author: User

1. What is the mode?

Pattern. It is actually a methodology for solving a certain type of problems. You sum up the methods for solving a certain type of problems to the theoretical level, that is, the mode.

Alexander's classic definition is that each mode describes a problem that is constantly emerging in our environment, and then describes the core of the solution to the problem. In this way, you can use existing solutions countless times without repeating the same work.

The mode has different fields, the construction field has the construction mode, and the software design field also has the design mode. When a domain gradually matures, many models will naturally emerge.

What is a framework?

Framework. In fact, it is a semi-finished product of an application, that is, a group of parts for you to choose to complete your own system. Simply put, you can use a stage set up by others to perform performances. In addition, the framework is generally mature and constantly upgraded software.

2. Why use the mode?

Because the mode is a kind of guidance, under a good guidance, it will help you complete the task, and help you make a good design solution to achieve twice the result with half the effort. In addition, we can find the best solution to the problem.

Why use the framework?

As software systems have become very complex today, especially the knowledge, content, and problems of server-side software and design. Using someone else's mature framework in some ways is equivalent to letting someone else do some basic work for you. You only need to concentrate on completing the business logic design of the system. In addition, the framework is generally mature and robust. It can handle many details of the system, such as transaction processing, security, and data flow control. There are also frameworks that are generally used by many people, so the structure is very good, so the scalability is also very good, and it is constantly upgraded, you can directly enjoy others' upgradesCodeBenefits.

The framework is generally located at the intermediate layer between the low-level application platform (such as J2EE) and the high-level business logic.

Why is software layered?

To achieve high cohesion and low coupling ". Divide the problem into various solutions, which are easy to control, easy to extend, and easy to allocate resources... In short, there are many advantages :).

3. The following describes the Java and J2EE models and frameworks:

What are common design patterns?

First, you need to understand the book gof's design patterns-the basis for reusable object-oriented software (this can be said to beProgramNote: gof is not a person, but four people. Its original intention is gangs of four, which refers to the four authors of this book: Erich Gamma, Richard Helm, Ralph Johnson, and John vlissides. This book describes 23 main models, including abstract factory, adapter, and appearance model.

There are many other models, estimated to be more than 100.

There are too many software design patterns, so let me briefly describe the most common MVC pattern.

The MVC pattern was proposed by buschmann in 1996:

Model: encapsulates data and all operations based on the data.

View: encapsulates the display of data, that is, the user interface.

Controller: encapsulates operations on the model and controls the flow of data.

In addition:

The Unified Process of software (Rational Unified Process), XP (eXtreme Programming) Extreme Programming, these are usually called "process methods", is a methodology of the implementation process of software projects, it is a method strategy proposed for the implementation process of software projects. It is also another mode.

4. What are common Java frameworks?

WAF:

Full name: Web Application Framework

Main Application: EJB layer (web layer also exists, but it is relatively weak ).

Main application technologies: EJB, etc.

Source: http://java.sun.com/blueprints/code/index.html

Brief description: this is an example that Sun used to demonstrate the J2EE platform. The framework in PetStore is as follows. It is the application framework proposed in the sun blue book example program. It implements MVC and other good design patterns. Sun's website hasTechnical materials, It is best to download PetStore for research, WebLogic comes with this system, the source code is in BEA/weblogic700/samples/Server/src/PetStore. This is the preferred framework for learning about J2EE.

Struts:

Main Application: web layer.

Main application technologies: JSP, taglib, JavaBean, XML, etc.

Source: http://jakarta.apache.org/struts/index.html

Brief description: this is an open-source project of Apache, which is widely used at present. Based on the MVC mode, the structure is good and Based on JSP. In jbuilder8, struts1.02 has been integrated.

Briefly describe the example of combining WAF with Struts: struts for the web layer and WAF for the EJB layer:

JSP (taglib) --> actionform --> action --> event --> ejbaction --> EJB --> Dao --> database JSP (taglib) (forward) <-- Action <-- eventresponse <--

Turbine:

Main Application: web layer.

Main application technologies: servlet, etc.

Source: http://jakarta.apache.org/turbine/index.html

Brief description: this is an open-source project of Apache. Based on servlet. It is said that the speed is relatively fast, and various services are provided based on the Service (Pluggable implementation pluggable Execution Component) method.

Cocoon:

Main Application: web layer.

Main application technologies: XML, xsp, Servlet, etc.

Source: http://cocoon.apache.org/2.0/

Summary: this is an open-source project of Apache. XML-based and xsp-based (generally speaking, xsp is a dynamic XML document formed after Java program segments are added to XML static documents .). It can interact with a variety of data sources, including file systems, databases, LDAP, XML resource libraries, and network data sources.

Echo:

Main Application: web layer.

Main Application Technology: Servlet

Source: http://www.nextapp.com/products/echo/

Brief description: an open source project of nextapp. Based on servlet. The page can be very beautiful. Combined with echopoint, you can make a lot of graphic effects (jfreechart package is used in it ). Use the swing idea for web pages and use HTML as a Java class. However, when a large number of sessions are used, there are a lot of page frames, which consumes a lot of system resources.

Jato:

Full name: Sun ONE Application Framework

Main Application: web layer.

Main application technologies: JSP, taglib, and JavaBean

Source: http://www.sun.com/

Brief description: this is a commercial framework launched by Sun. It is known that it is based on Sun ONE's platform. I downloaded jato2.0 and looked at it. It seems a bit simple. I used JSP + taglib + JavaBean. As his doc says, Jato is suitable for small web applications.

TCF:

Full name: Thin-client framework

Main Application: Java GUI.

Main application technologies: Java application

Source: http://www.alphaworks.ibm.com/tech/tcf

Summary: this is a framework developed by IBM. Based on the MVC mode and Java application. Recommended Introduction Article : Http://www-900.ibm.com/developerWorks/cn/java/j-tcf1/index.shtml
Source: CCID Technical Community Author: baocl

after reading this article, I should be as open-minded as my friends who are confused about the framework.

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.