16.10.2015 Views

Getting Startedwith pureQuery

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

14<br />

Chapter 14 - Best Practices<br />

In the previous chapters of this book, we have introduced <strong>pureQuery</strong> and described in<br />

detail its major components: API, runtime and tools. In this chapter we will describe best<br />

practices for each one of those components.<br />

14.1 Best Practices: The big picture<br />

<strong>pureQuery</strong> is a platform designed to deliver increased productivity to developers, and<br />

improved performance, maintainability, monitoring and security for applications. In addition<br />

to the improvements that your application will get by using <strong>pureQuery</strong>, there are still some<br />

best practices that help you get the most out of <strong>pureQuery</strong> in certain scenarios. In this<br />

chapter, we will go over some of those best practices and will identify in which scenario we<br />

recommend their usage.<br />

Previously to the writing of this book, the <strong>pureQuery</strong> team has also published an article on<br />

some best practices, titled “Write high performance Java data access applications, Part 3:<br />

Data Studio <strong>pureQuery</strong> API best practices”. This article was part of a series on developing<br />

high performance Java data access applications and the list of best practices covered<br />

focused on the <strong>pureQuery</strong> API. In this chapter, we will provide some additional best<br />

practices that focus not only on the API, but also on the tools and runtime components.<br />

14.2 Choose your style: inline vs annotated method style<br />

In Chapters 12 and 13, we described the Inline and Annotated method programming styles<br />

for the <strong>pureQuery</strong> API. Both styles have their own advantages, so here are some<br />

guidelines on which style to pick when developing your <strong>pureQuery</strong> application:<br />

Use <strong>pureQuery</strong> annotated style if you:<br />

• Want to use static SQL at runtime<br />

• Prefer to have your SQL separated from your business logic<br />

• Want a simple data access layer code generated by the Optim Development<br />

Studio tooling<br />

• Like to use XML files to define your data access layer

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!