Last update: December 19, 2014 07:37 AM
December 10, 2014
November 28, 2014
The book begins by providing a general understanding RESTful web services, design principals, and the differences between the various HTTP verbs. This discussion is provided at a high level, such that it is generalized enough to cover various RESTful web service implementations. The first chapter then goes into the Java API for RESTful Web Services. This section of the first chapter is brief, and to the point. It clearly explains how to create services and then test/access them via the Client API, cURL, and other utilities. As mentioned at the top of this post, Chapter 1 provides a solid foundation...and it is a quick read also, which enables developers to get up and running quickly with the JAX-RS API.
Chapter 2 covers fundamentals, such as returning various content types (JSON, XML, etc.), and designing meaningful URL patterns to obtain the desired media type. This chapter delves into streaming and chunked content, parsing JSON, and versioning support. Chapter 2 builds upon Chapter 1 very nicely, further explaining the fundamental concepts of RESTful services.
The third chapter covers security, validation, and logging of RESTful web services. This is a chapter for intermediate users, as it goes beyond the basics and covers the use of filters for logging, and constraint annotations for validation. It then provides a brief example of building an exception class. Lastly, this chapter goes into authentication practices using SAML (Security Assertion Markup Language), OAuth, and tokens. While this chapter sets a good stage for discussing the various types of authentication, it does not go into detail on these topics.
Chapter 4 covers performance via caching, asynchronous and long-running jobs, and partial updates. The chapter clearly explains how to utilize the Cache-Control header and ETags. It then explains how to design asynchronous web services, and some best practices. The last topic in the chapter is partial updates...a topic that is briefly explained, but leaves room for further exploration.
The next chapter goes into advanced topics for RESTful web services...including rate-limiting, response pagination, internationalization and localization, and pluggability and extensibility. I really liked the way that this chapter covered rate-limiting in detail, and explained why this is an important topic. It then provides a detailed explanation for response pagination, along with a good example. The internationalization and localization section is brief, but provides a good enough explanation for getting started with internationalization. Lastly, the chapter provides a brief overview HATEOAS (Hypermedia as the Engine of Application State), testing, and extensibility.
The final chapter does a good job of wrapping up the many topics of RESTful web services, discussing the future of REST and emerging standards. It is a chapter that explains polling and the importance of providing real-time APIs for avoiding inefficiencies. Along the way, it touches upon various topics, such as WebHooks, SSEs (Server Sent Events), and WebSockets, and how they relate to RESTful services.
The book contains a helpful Appendix which covers various APIs from GitHub, Facebook, and Twitter. It is a nice closeout to the book, providing an overview of how to glean information from these important social media networks.
Overall, this book is a great read for getting started with RESTful web service creation and utilization with JAX-RS. I enjoyed the fact that the book was authored by Bhakti, who is very experienced with the topic, as she is a founding member of the GlassFish Application Server. I recommend this read for anyone who wants to get up and running quickly with REST, and also learn about various other RESTful concepts along the way. While this book does not delve into fine-grained details of topics such as authentication and partial updates, it provides a good foundation for learning more on such topics. Readers will go away from this book with a solid understanding of how to develop RESTful web services, and they will be able to start developing services after reading through the book. Those who wish to delve into more advanced topics will be provided with a good overview after reading this book, and they'll be pointed into the right direction for learning more on such topics.
November 23, 2014
Have you heard of the NetBeans JPQL tool? This is an often overlooked feature of NetBeans IDE that can save developers a lot of time.
If you are a Java EE developer, then you've likely encountered moments when you would like to see the results of a Java Persistence Query Language (JPQL) query before you've written your session bean method. Being that I come from a database administrator background, I am oftentimes finding myself at the SQL command-line (or NetBeans SQL Editor) writing queries, and then translating the SQL into JPQL. NetBeans IDE contains a JPQL tool (since NetBeans 7.3), which makes it easy to write JPQL queries and retrieve results immediately. Let's see how:
The JPQL tool can be invoked within the context of a NetBeans project. The project must have a valid Persistence Context, meaning that it is wired up for database access. Once this is in-place, simply right click on the persistence.xml file, and click on the "Run JPQL Query" to open the tool.
The tool provides a nice editor that provides a top pane for entering a query, and a bottom pane for showing the SQL or the results of the query execution. If you have more than one Persistence Context within your persistence.xml, then you will have the option to select which context you would like to utilize for the query.
To execute the JPQL, simply click on the button next to the Persistence Context pull-down, or right click in the query editor and choose "Run JPQL".
The tool comes in super handy when you are executing queries that involve more than one entity.
Another handy reference for the tool, Geertjan's blog post:
Note: Be sure to "Build" your project successfully before trying to use the JPQL tool. If you do not have a successful build, you will likely encounter an error stating that the abstract schema type cannot be found:
November 21, 2014
TLDR; Velocity is a great conference for web and operations people, and why didn't you go already?