Boost Your Java EE Productivity with Live Templates

Boost Your Java EE Productivity with Live Templates


Ah, Hollywood! It’s time for another 2 Minute Tech Tip! This two-minute tech tip was sent in by Java Champion and independent consultant Sebastian Dashner. Today I want to show you how to be more productive programming Java and programming using an IDE in general. So if you use your IDE — we have IntelliJ here — and you’re, for example programming in Java, what helps you a lot is using so-called Live Templates. That means templates that are predefined for you and you could just access them by an easy shortcut for things you use very often. For example, if we use Java EE, we very often inject some elements, right? by @Inject. So what we can do is just define something, like a Live Template IJT. And by hitting tab you can @Inject something, right? So you can add something here. The same is true if we want to have a managed execute a service, for example. Or, very often needed, an entity manager. Or, we are in a test and we want some test method. The same is true for post construct pre-destroy, and whatever you want to configure, right? So we configure these in the settings under Live Templates. And you can define your own templates and template plate groups. And you do so by defining the code plus some special variables. And then you can just use them right away by typing the abbreviation and hitting tab. So thanks for watching. What did you think of that tip? I’m happy about it! We want your opinion! Thanks for watching and stay tuned

Leave a Reply

Your email address will not be published. Required fields are marked *