tailieunhanh - Expert Spring MVC and Web Flow phần 2

Lưu ý Từ góc nhìn của một nhà phát triển web, các lớp giao diện người dùng là rất quan trọng củatrừu tượng. Thật dễ dàng để xem xét giao diện người sử dụng như là một lớp con dưới lớp web đầy đủ, và quan điểm này không phải là không chính xác. | CHAPTER 3 SPRING MVC APPLICATION ARCHITECTURE 25 Note From the perspective of a web developer the user interface layer is a very important level of abstraction. It s easy to consider the user interface as a sublayer below the full web layer and this view is not incorrect. For the purposes of this book specializing in web applications we ve elevated the user interface to a formal layer because it has its own set of concerns and implementation details. The user interface layer is typically the top layer. Conceptually this means it is the last layer in the processing chain before the bytes are sent to the client. By this point all the business logic has been performed all transactions are committed and all resources have been released. Being last in this case is a good thing. The user interface layer is responsible for rendering the bytes that are sent to the client. The client in a web application is remote and connected via an unreliable The transfer of bytes can slow down be repeated or even stop. The UI layer is kept separate from the other layers because we want the system to continue to process other requests with valuable resources such as database connections without having to wait on network connections. In other words the act of rendering a response for a client is separate from the act of gathering the response. Another reason for isolating the user interface into its own layer is the practical reality that there are many toolkits for rendering the user interface. Some examples include JSP Velocity FreeMarker and XSLT all of which are well supported by Spring . Putting the UI concerns behind its own layer allows the rendering technology to change without affecting the other layers. The other layers of the system should be hidden from the choice of the rendering toolkit. There are simply too many options each with its own pros and cons to tie a particular toolkit directly into the system. Teams with a dedicated UI specialist benefit greatly by .

TỪ KHÓA LIÊN QUAN