Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the mechanism of SimpleFramework components?

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what is the mechanism of SimpleFramework components". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the mechanism of SimpleFramework components".

Frame mode:

In Web applications, whether the server uses (Java EE or .net), the client's request (Request) is parsed by Web or the application server, and the final response (Response) content body returned to the client is HTML (including Javascript script, CSS, etc.). This provides an opportunity to solve the problem, that is, before the response content is returned to the client (browser), the response is "intercepted", the response HTM is parsed, and the response is reprocessed, which is the "post-processing" application mode. There are two implementation schemes: server side (filter, interceptor, etc.) and client side (plug-in, etc.). Under the Java EE system, various Web or application servers (Weblogic, Websphere, JBoss, Tomcat, etc.) happen to provide a "Filter" or "Interceptor" mechanism, which lays a technical foundation and provides a technical approach for the implementation of the above patterns.

SimpleFramework provides the net.simpleframework.web.page.PageFilter class to implement the Filter mechanism, and it should be noted that the Filter should be at the top level, as shown in the following figure

The filter-based post-processing mode, which is actually an extension of MVC2 by using the filter mechanism, is an organic combination of two MVC2 modes: first, "Filter" as the "Controller", and another MVC2 as its "virtual model". Then the "Model" is decomposed into a complete MVC2, which is composed of the original Model, the parser (Parser) and the logic processor (HandleClass) of the Post-View (based on the definition of XML).

As shown in the following figure

Open architecture:

Filter-based implementation mechanism and declarative component applications enable SimpleFramework to adapt to the development of new Java EE technologies in the future-only need to upgrade the framework implementation without large-scale application code changes

The implementation mechanism based on filter and post-processing pattern determines its "open"resource" application characteristics, so that SimpleFramework can integrate not only existing application resources, but also existing framework and component resources.

SimpleFramework implements open component architecture (component registration, component instance, component resource provider, component lifecycle management, etc.), so that Web application developers can customize application components on demand according to component specifications, or build composite application components based on existing components.

Follow the standards:

The implementation technology adopted by SimpleFramework is Java EE at the back end and HML+Javascript+CSS at the front end, all of which are industry standards.

SimpleFramework does not create its own proprietary tags or other standards. The standards it follows are Java EE's native or solid standards, that is, JSP, Servlet, TagLib (tag libraries are not recommended), etc.

SimpleFramework uses JSF-like XML-like component declarations, but the semantics are more concise

SimpleFramework "is not to reinvent the wheel", but its unique "post-processing" feature can be used as an organic supplement and lossless extension of the existing Web framework.

The filter-based implementation mechanism of SimpleFramework determines that it can not only support the full development of Web applications, but also integrate with other Web framework technologies or partially apply SimpleFramework components or functions.

About the event:

SimpleFramework is a component-based MVC framework, and all events are reflected through client-side HTML and Javascript.

Unlike other Request-based MVC frameworks (Struts, SpringMVC, etc.), SimpleFramework automatically generates component Javascript objects for the client through $Actions, which are highly encapsulated, and the event code can be called more simply and flexibly.

Compared with the event-driven Web framework (JSF, Wicket, etc.), SimpleFramework uses the existing Web specification as far as possible, does not define a tag library, accords with the programming habits of Web, and is more efficient. Here are the relevant comparisons:

Thank you for your reading, the above is the content of "what is the mechanism of SimpleFramework components". After the study of this article, I believe you have a deeper understanding of what the mechanism of SimpleFramework components is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report