Saturday, May 9, 2015

Almost all of us when programming web applications with [Java Servlet] [The Java EE 6 Tutorial] are


Spring Framework was born as an option, replaces maroc the standard model in developing EJB JavaEE application marks a historic turning point in the development of Enterprise Java. Spring is constantly evolving and growing in popularity in the Java community. According to the [job search website Indeed] (http://www.indeed.com/) until early 2014, the rate of increase in employment in Spring always higher than EJB.
One of the key components, the foundation and create the power of Spring IoC container maroc is. Spring maroc IoC container is based on the principle of Inversion of Control (reverse control), has appeared quite long in design patterns (Design Pattern), and was popularized by Robert C. Martin and Martin Fowler. To learn about Spring, maroc first we need to understand the concept of what is Inversion maroc of Control? For this, we need to answer the question: Control (control) in the software program is, and Inversion (reversal) for controls maroc in this context is understood how.
Although there were some Vietnamese article on this subject, such as Inversion of Control discussed at pages congdongjava.com, Self build 1 reverse control framework, concept of Inversion of Control (IoC) and Dependency Injection (DI) in Spring (or you can find more on google), after a while of thinking I venture to write back and share his insights about IoC, hope those interested maroc to contribute maroc the discussion so that we better understand the issue. Flow Control maroc application be?
Due to increasingly complex program, so we applied the method object-oriented programming to classification, separation and collection functions into objects. It also created maroc the library can make available for reuse. Execution flow of the program, maroc in these situations should be considered at the aggregate maroc level, no longer concerned about the execution step further specific statements, which relate only to the method calls of objects in applications as well as the object of pre-built library.
Programmers, when building applications from scratch, maroc made two tasks: direct control execution flow of the program and build the functionality to meet the application's operation. In fact, there are many programs or parts of programs have very similar thread of execution, such as interaction with the HTTP section in the web application, the unit testing of applications, ... The direct creation and testing executable control program flow repeated when building multiple applications will lose a lot of effort, cost, creating maroc boredom and error-prone. This creates maroc environmental dynamics as well as to the principle of reverse control flourish and grow. Inversion is understood to mean?
One of my colleagues asked me a question earlier, and I was asking you was searching on Google for articles in English and Vietnamese. After searching and reading the article, you told me that there are still very vague and confusing to those troubling questions, like: Invert control what is reversed: if out controls at this is implemented in the application flow, where the reverse control maroc is executed reverse order? Reverse controls consistent with the concept of "dependent pump" (Dependency Injection)? If not identical, they differ in where?
Almost all of us when programming web applications with [Java Servlet] [The Java EE 6 Tutorial] are clearly visualize the following programming steps: Create maroc object classes inherit from HttpServlet, overloaded methods doGet () - doPost (), then register in the configuration file Servlet Deployment Descriptor This corresponds with the path determined. Servlet class object we create will be called on when there is a HTTP request path "fit" with the path declared in the Deployment Descriptor. maroc
Sometimes we have to wonder: who enabled applications that we write to respond whenever Http Request sent? who is responsible for converting messages Http (HTTP Request and HTTP response) into Java objects (HttpServletRequest and HttpServletResponse) for transmission to the jaw doGet (), doPost ()? The answer is obvious and immediate: Servlet Container's. Example 2: Programming Unit Testing with JUnit
During development of the functional components of the application, we usually apply the test component (Unit Testing) to ensure it does run properly function during the application is expanded and developed maroc further. To create a Unit Test, we just create maroc a class object, define the constructor method, the method ends and test methods. Then, we just run the test to test.
With two examples above, we found in the applications maroc to change the role: applications no longer taking on direct medium build and control the flow of execution, medium maroc build business function. The control flow execution is separate from but

No comments:

Post a Comment