Java Magazine, March/April 2017
ORACLE COM JAVAMAGAZINE MARCH APRIL 2017 30 ui tools Applications can be built using several diferent design architectures Developers have come a long way from developing web applications using a single JSP page and embedding Java source code directly into the page Maintenance on such applications was miserable and they were not much fun to develop Nowadays developers have learned that it makes sense to separate code into diferent portions to promote easier maintenance and development One of the most popular application design architectures is model view controller MVC This architectural pattern separates logic into three distinct categories The model pertains to the database and any code that is used to bind data the view is the code that is used to generate the front end and the controller pertains to the application business logic and intermediate code between the data and the web view The MVC 10 framework follows the MVC design architecture and it puts the developer into the drivers seat for making lowlevel design choices and developing custom web controls MVC 10 was considered for inclusion in Java EE 8 as JSR 371 Since that time Oracle has instead sought to move control of the project to the community In this article I examine this new framework and explain why I like it even though there are many other great choices I also develop an application from the ground up using MVC 10 in the NetBeans IDE allowing you to follow along each step of the way Why MVC 10 For many of years the most popular MVC framework for use with Java EE has been JavaServer Faces JSF which follows the MVC architecture and cleanly separates each of the three categories The JSF framework makes web application development easy because it takes much of the guesswork out of the design and thus allows the developer to focus on the business logic That said JSF makes some assumptions for the developer and is not very flexible in some areas For instance JSF is very targeted with regard to scoping and each request follows a complex set of phases through which validation and other tasks occur JSF can be customized but there are certain ceremonies that must be followed in order to do so One of the key features of JSF is the bundled component architecture which allows web components to be bundled and made portable for other JSF applications This abstracts the details of the JavaScript and CSS from the developer so a tag can simply be placed into the view to render a fully implemented component JSF has a large ecosystem of component libraries available which provide many options MVC 10 does not contain any components leaving the view completely up to the developer However this design does not mean options are not available because MVC allows just about any view technology to be used to create a front end The new framework does not contain request phases JOSH JUNEAU MVC 10 A Fresh New Framework for Enterprise Apps A look at a remarkably flexible framework that builds on JAX RS
You must have JavaScript enabled to view digital editions.